diff --git a/files/.config/configstore/update-notifier-npm.json b/files/.config/configstore/update-notifier-npm.json index 65dde6b..e54ea53 100644 --- a/files/.config/configstore/update-notifier-npm.json +++ b/files/.config/configstore/update-notifier-npm.json @@ -1,4 +1,4 @@ { "optOut": false, - "lastUpdateCheck": 1598261358949 + "lastUpdateCheck": 1598364175433 } \ No newline at end of file diff --git a/files/.config/htop/htoprc b/files/.config/htop/htoprc index 10530b2..0e8f46a 120000 --- a/files/.config/htop/htoprc +++ b/files/.config/htop/htoprc @@ -1 +1 @@ -/nix/store/9pbs833w662kd30yb8q5lr0s7qvryzkr-home-manager-files/.config/htop/htoprc \ No newline at end of file +/nix/store/af3jc2hqh3x6mi3blx02jrykilppmr09-home-manager-files/.config/htop/htoprc \ No newline at end of file diff --git a/files/.xmonad/lib/Config.hs b/files/.xmonad/lib/Config.hs index f746429..b2fed68 100644 --- a/files/.xmonad/lib/Config.hs +++ b/files/.xmonad/lib/Config.hs @@ -321,6 +321,7 @@ myKeys = concat [ zoomRowBindings, tabbedBindings, multiMonitorBindings, program , ("M-b", safeSpawnProg "firefox") , ("M-S-", spawn "alacritty") --, ("M-S-", launchWithBackgroundInstance (className =? "Alacritty") "alacritty") + , ("M-S-<", spawn "flameshot gui") ] miscBindings :: [(String, X ())] diff --git a/files/glowStyle.json b/files/glowStyle.json new file mode 100644 index 0000000..b9e9a53 --- /dev/null +++ b/files/glowStyle.json @@ -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": {} +} diff --git a/files/nix-stuff/nixpkgs/home.nix b/files/nix-stuff/nixpkgs/home.nix index 51d3b28..5cb9c94 100644 --- a/files/nix-stuff/nixpkgs/home.nix +++ b/files/nix-stuff/nixpkgs/home.nix @@ -8,17 +8,16 @@ { config, pkgs, ... }: { - 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; + nixpkgs = { + config = { + allowUnfree = true; + 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 ]; - - } diff --git a/files/nix-stuff/nixpkgs/modules/base.nix b/files/nix-stuff/nixpkgs/modules/base.nix index 53985a3..2556827 100644 --- a/files/nix-stuff/nixpkgs/modules/base.nix +++ b/files/nix-stuff/nixpkgs/modules/base.nix @@ -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 ] ) ]; diff --git a/files/nix-stuff/nixpkgs/modules/desktop.nix b/files/nix-stuff/nixpkgs/modules/desktop.nix index 77b6623..989d645 100644 --- a/files/nix-stuff/nixpkgs/modules/desktop.nix +++ b/files/nix-stuff/nixpkgs/modules/desktop.nix @@ -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 ]; diff --git a/files/nix-stuff/nixpkgs/modules/desktop/alacritty.nix b/files/nix-stuff/nixpkgs/modules/desktop/alacritty.nix index 195f2fa..874bdec 100644 --- a/files/nix-stuff/nixpkgs/modules/desktop/alacritty.nix +++ b/files/nix-stuff/nixpkgs/modules/desktop/alacritty.nix @@ -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 = { diff --git a/files/nix-stuff/nixpkgs/modules/term/tmux.nix b/files/nix-stuff/nixpkgs/modules/term/tmux.nix index 337e154..ed3d740 100644 --- a/files/nix-stuff/nixpkgs/modules/term/tmux.nix +++ b/files/nix-stuff/nixpkgs/modules/term/tmux.nix @@ -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}" diff --git a/files/nix-stuff/nixpkgs/nix/sources.json b/files/nix-stuff/nixpkgs/nix/sources.json index 9e0b663..357eef2 100644 --- a/files/nix-stuff/nixpkgs/nix/sources.json +++ b/files/nix-stuff/nixpkgs/nix/sources.json @@ -23,6 +23,18 @@ "url": "https://github.com/nmattia/niv/archive/89ae775e9dfc2571f912156dd2f8627e14d4d507.tar.gz", "url_template": "https://github.com///archive/.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///archive/.tar.gz" + }, "nixpkgs": { "branch": "release-20.03", "description": "Nix Packages collection", diff --git a/files/nix-stuff/nixpkgs/nix/sources.nix b/files/nix-stuff/nixpkgs/nix/sources.nix index 7bd0f3e..b64b8f8 100644 --- a/files/nix-stuff/nixpkgs/nix/sources.nix +++ b/files/nix-stuff/nixpkgs/nix/sources.nix @@ -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); } diff --git a/files/nix-stuff/nixpkgs/overlay/cool-retro-term.nix b/files/nix-stuff/nixpkgs/overlay/cool-retro-term.nix index 2e69e50..075cf40 100644 --- a/files/nix-stuff/nixpkgs/overlay/cool-retro-term.nix +++ b/files/nix-stuff/nixpkgs/overlay/cool-retro-term.nix @@ -1,6 +1,16 @@ -{ pkgs }: +{ nixGL, symlinkJoin, makeWrapper, writeScriptBin, cool-retro-term }: +symlinkJoin { + name = "cool-retro-term"; + nativeBuildInputs = [ makeWrapper ]; -pkgs.writeScriptBin "cool-retro-term" '' - #!/bin/sh - exec nixGLIntel ${pkgs.cool-retro-term}/bin/cool-retro-term "$@" -'' + paths = [ + ( + writeScriptBin "cool-retro-term" '' + writeScriptBin "cool-retro-term" + #!/bin/sh + exec ${nixGL.nixGLIntel}/bin/nixGLIntel ${cool-retro-term}/bin/cool-retro-term "$@" + '' + ) + cool-retro-term + ]; +} diff --git a/files/nix-stuff/nixpkgs/overlay/default.nix b/files/nix-stuff/nixpkgs/overlay/default.nix index 6004462..c64a12f 100644 --- a/files/nix-stuff/nixpkgs/overlay/default.nix +++ b/files/nix-stuff/nixpkgs/overlay/default.nix @@ -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 {}; } diff --git a/files/nix-stuff/nixpkgs/packages/alacritty-overlay.nix b/files/nix-stuff/nixpkgs/packages/alacritty-overlay.nix new file mode 100644 index 0000000..7f5d7eb --- /dev/null +++ b/files/nix-stuff/nixpkgs/packages/alacritty-overlay.nix @@ -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 ]; +} diff --git a/files/nix-stuff/nixpkgs/result b/files/nix-stuff/nixpkgs/result deleted file mode 120000 index a60e11d..0000000 --- a/files/nix-stuff/nixpkgs/result +++ /dev/null @@ -1 +0,0 @@ -/nix/store/pk0kjc9f85yyb4y1rb5hralpwr4ai3rp-options.json \ No newline at end of file