Cleanup nix

This commit is contained in:
elkowar 2020-08-26 00:26:00 +02:00
parent 67268815e0
commit 11f40b96b0
15 changed files with 314 additions and 44 deletions

View file

@ -1,4 +1,4 @@
{
"optOut": false,
"lastUpdateCheck": 1598261358949
"lastUpdateCheck": 1598364175433
}

View file

@ -1 +1 @@
/nix/store/9pbs833w662kd30yb8q5lr0s7qvryzkr-home-manager-files/.config/htop/htoprc
/nix/store/af3jc2hqh3x6mi3blx02jrykilppmr09-home-manager-files/.config/htop/htoprc

View file

@ -321,6 +321,7 @@ myKeys = concat [ zoomRowBindings, tabbedBindings, multiMonitorBindings, program
, ("M-b", safeSpawnProg "firefox")
, ("M-S-<Return>", spawn "alacritty")
--, ("M-S-<Return>", launchWithBackgroundInstance (className =? "Alacritty") "alacritty")
, ("M-S-<", spawn "flameshot gui")
]
miscBindings :: [(String, X ())]

207
files/glowStyle.json Normal file
View file

@ -0,0 +1,207 @@
{
"document": {
"block_prefix": "\n",
"block_suffix": "\n",
"color": "#ebdbb2",
"margin": 2
},
"block_quote": {
"indent": 1,
"indent_token": "│ "
},
"paragraph": {},
"list": {
"level_indent": 2
},
"heading": {
"block_suffix": "\n",
"color": "#8ec07c",
"bold": true
},
"h1": {
"prefix": " ",
"suffix": " ",
"color": "#1d2021",
"background_color": "#689d6a",
"bold": true
},
"h2": {
"prefix": "## ",
"color": "#8ec07c",
"background_color": "#282828"
},
"h3": {
"prefix": "### ",
"color": "#8ec07c",
"background_color": "#282828"
},
"h4": {
"prefix": "#### ",
"color": "#8ec07c",
"background_color": "#282828"
},
"h5": {
"prefix": "##### ",
"color": "#8ec07c",
"background_color": "#282828"
},
"h6": {
"prefix": "###### ",
"color": "#8ec07c",
"background_color": "#282828",
"bold": false
},
"text": {},
"strikethrough": {
"crossed_out": true
},
"emph": {
"italic": true
},
"strong": {
"bold": true
},
"hr": {
"color": "240",
"format": "\n--------\n"
},
"item": {
"block_prefix": "• "
},
"enumeration": {
"block_prefix": ". "
},
"task": {
"ticked": "[✓] ",
"unticked": "[ ] "
},
"link": {
"color": "#83a598",
"background_color": "#282828",
"underline": true
},
"link_text": {
"color": "#b8bb26",
"background_color": "#282828",
"bold": true
},
"image": {
"color": "#928374",
"background_color": "#282828",
"underline": true
},
"image_text": {
"color": "#fabd2f",
"background_color": "#282828",
"format": "Image: {{.text}} →"
},
"code": {
"prefix": " ",
"suffix": " ",
"color": "203",
"background_color": "236"
},
"code_block": {
"color": "244",
"margin": 2,
"chroma": {
"text": {
"color": "#ebdbb2"
},
"error": {
"color": "#fb4934"
},
"comment": {
"color": "#676767"
},
"comment_preproc": {
"color": "#FF875F"
},
"keyword": {
"color": "#00AAFF"
},
"keyword_reserved": {
"color": "#FF5FD2"
},
"keyword_namespace": {
"color": "#FF5F87"
},
"keyword_type": {
"color": "#6E6ED8"
},
"operator": {
"color": "#EF8080"
},
"punctuation": {
"color": "#E8E8A8"
},
"name": {
"color": "#83a598"
},
"name_builtin": {
"color": "#FF8EC7"
},
"name_tag": {
"color": "#B083EA"
},
"name_attribute": {
"color": "#7A7AE6"
},
"name_class": {
"color": "#ebdbb2",
"underline": true,
"bold": true
},
"name_constant": {},
"name_decorator": {
"color": "#FFFF87"
},
"name_exception": {},
"name_function": {
"color": "#8ec07c"
},
"name_other": {},
"literal": {},
"literal_number": {
"color": "#fabd2f"
},
"literal_date": {},
"literal_string": {
"color": "#C69669"
},
"literal_string_escape": {
"color": "#AFFFD7"
},
"generic_deleted": {
"color": "#FD5B5B"
},
"generic_emph": {
"italic": true
},
"generic_inserted": {
"color": "#00D787"
},
"generic_strong": {
"bold": true
},
"generic_subheading": {
"color": "#8ec07c"
},
"background": {
"background_color": "#373737"
}
}
},
"table": {
"center_separator": "┼",
"column_separator": "│",
"row_separator": "─"
},
"definition_list": {},
"definition_term": {},
"definition_description": {
"block_prefix": "\n🠶 "
},
"html_block": {},
"html_span": {}
}

View file

@ -8,17 +8,16 @@
{ config, pkgs, ... }:
{
nixpkgs.config = {
nixpkgs = {
config = {
allowUnfree = true;
overlays = [
(import ./overlay)
];
packageOverrides = pkgs: {
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
inherit pkgs;
};
};
};
overlays = [ (import ./overlay) ];
};
@ -29,15 +28,11 @@
enableFish = true;
enableZsh = true;
includeNiceToHaves = true;
includeHaskellDev = true;
};
desktop.enable = true;
desktop.colors = import ./modules/desktop/colors/gruvbox.nix;
};
imports = [ ./modules ];
}

View file

@ -3,6 +3,15 @@ let
cfg = config.elkowar.base;
elkowar_local = import ../local/default.nix {};
sources = import ../nix/sources.nix;
addFlags = package: name: flags: pkgs.symlinkJoin {
name = name;
paths = [ package ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/${name} --add-flags "${flags}"
'';
};
in
{
options.elkowar.base = {
@ -10,6 +19,7 @@ in
enableFish = lib.mkEnableOption "Fish shell";
enableZsh = lib.mkEnableOption "Zsh shell";
includeNiceToHaves = lib.mkEnableOption "Add nice-to-have, non-essential programs";
includeHaskellDev = lib.mkEnableOption "Include large haskell development packages";
};
imports = [ ./term ./generalConfig.nix ];
@ -35,26 +45,37 @@ in
sources.manix
direnv
rnix-lsp
nix-prefetch-git
niv
bat
exa
trash-cli
ripgrep
fd
jq
nodejs
nodePackages.bash-language-server
nodePackages.dockerfile-language-server-nodejs
(addFlags bat "bat" "--theme base16")
cachix
]
(
lib.mkIf cfg.includeNiceToHaves [
(addFlags glow "glow" "--style ~/.config/glowStyle.json")
mdcat
haskellPackages.nix-tree
cloc
fet-sh
mdcat
github-cli
websocat
gtop
nix-prefetch
]
)
(
lib.mkIf cfg.includeHaskellDev [
cabal2nix
cabal-install
]
)
];

View file

@ -12,21 +12,16 @@ in
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
(pkgs.callPackage ../packages/bashtop.nix { })
(pkgs.callPackage ../packages/liquidctl.nix { })
(pkgs.callPackage ../packages/scr.nix { })
#(pkgs.callPackage ../packages/boox.nix { })
(pkgs.callPackage ../packages/mmutils.nix { })
(scr.override { extraPackages = [ rofi ]; })
mmutils
liquidctl
bashtop
cool-retro-term
gromit-mpx
dragon-drop
polybarFull
discord
#simplescreenrecorder
#hyper-haskell
];

View file

@ -10,12 +10,7 @@ in
config = lib.mkIf cfg.enable {
programs.alacritty = {
enable = true;
package = (
pkgs.writeScriptBin "alacritty" ''
#!/bin/sh
exec nixGLIntel ${pkgs.alacritty}/bin/alacritty "$@"
''
);
settings = {
live_config_reload = true;
window = {

View file

@ -19,6 +19,7 @@ in
escapeTime = 0;
customPaneNavigationAndResize = true;
extraConfig = ''
set -ga terminal-overrides ",*col*:Tc"
bind v split-window -h -c "#{pane_current_oath}"
bind b split-window -v -c "#{pane_current_oath}"
bind c new-window -c "#{pane_current_path}"

View file

@ -23,6 +23,18 @@
"url": "https://github.com/nmattia/niv/archive/89ae775e9dfc2571f912156dd2f8627e14d4d507.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixGL": {
"branch": "master",
"description": "A wrapper tool for nix OpenGL application",
"homepage": null,
"owner": "guibou",
"repo": "nixGL",
"rev": "210c6a8a547b4a548b89b08bd46ffedc396bc4f4",
"sha256": "08n0xmqfg63wrzlbffas9nw5jzgkx1answmn8pqyaib3gn7icby2",
"type": "tarball",
"url": "https://github.com/guibou/nixGL/archive/210c6a8a547b4a548b89b08bd46ffedc396bc4f4.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "release-20.03",
"description": "Nix Packages collection",

View file

@ -73,6 +73,15 @@ let
else
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
# If the environment variable NIV_OVERRIDE_${name} is set, then use
# the path directly as opposed to the fetched source.
replace = name: drv:
let
saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
in
if ersatz == "" then drv else ersatz;
# Ports of functions for older nix versions
# a Nix version of mapAttrs if the built-in doesn't exist
@ -119,13 +128,13 @@ let
then abort
"The values in sources.json should not have an 'outPath' attribute"
else
spec // { outPath = fetch config.pkgs name spec; }
spec // { outPath = replace name (fetch config.pkgs name spec); }
) config.sources;
# The "config" used by the fetchers
mkConfig =
{ sourcesFile ? ./sources.json
, sources ? builtins.fromJSON (builtins.readFile sourcesFile)
{ sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
, sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
, pkgs ? mkPkgs sources
}: rec {
# The sources, i.e. the attribute set of spec name to spec
@ -134,5 +143,6 @@ let
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
inherit pkgs;
};
in
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }

View file

@ -1,6 +1,16 @@
{ pkgs }:
{ nixGL, symlinkJoin, makeWrapper, writeScriptBin, cool-retro-term }:
symlinkJoin {
name = "cool-retro-term";
nativeBuildInputs = [ makeWrapper ];
pkgs.writeScriptBin "cool-retro-term" ''
paths = [
(
writeScriptBin "cool-retro-term" ''
writeScriptBin "cool-retro-term"
#!/bin/sh
exec nixGLIntel ${pkgs.cool-retro-term}/bin/cool-retro-term "$@"
''
exec ${nixGL.nixGLIntel}/bin/nixGLIntel ${cool-retro-term}/bin/cool-retro-term "$@"
''
)
cool-retro-term
];
}

View file

@ -1,3 +1,13 @@
let
sources = import ../nix/sources.nix;
in
self: super: {
cool-retro-term = super.callPackage ./cool-retro-term.nix {};
alacritty = super.callPackage ../packages/alacritty-overlay.nix { alacritty = super.alacritty; };
bashtop = super.callPackage ../packages/bashtop.nix {};
boox = super.callPackage ../packages/boox.nix {};
cool-retro-term = super.callPackage ./cool-retro-term.nix { cool-retro-term = super.cool-retro-term; };
liquidctl = super.callPackage ../packages/liquidctl.nix {};
mmutils = super.callPackage ../packages/mmutils.nix {};
nixGL = import sources.nixGL {};
scr = super.callPackage ../packages/scr.nix {};
}

View file

@ -0,0 +1,14 @@
{ nixGL, symlinkJoin, makeWrapper, writeScriptBin, alacritty }:
let
wrapped =
writeScriptBin "alacritty" ''
writeScriptBin "alacritty"
#!/bin/sh
exec ${nixGL.nixGLIntel}/bin/nixGLIntel ${alacritty}/bin/alacritty "$@"
'';
in
symlinkJoin {
name = "alacritty";
nativeBuildInputs = [ makeWrapper ];
paths = [ wrapped alacritty ];
}

View file

@ -1 +0,0 @@
/nix/store/pk0kjc9f85yyb4y1rb5hralpwr4ai3rp-options.json