diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-03-15 21:33:58 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-03-15 21:33:58 +0000 |
commit | 87bdd8565d5490e99c11b33782c924dfa53896c9 (patch) | |
tree | a3a2378b3abf9a10fa86365abedf50e6d7eae135 /modules | |
parent | f100aa70d9de357c04bb97b7fe28c3751ecd2e0e (diff) | |
download | nixlib-87bdd8565d5490e99c11b33782c924dfa53896c9.tar nixlib-87bdd8565d5490e99c11b33782c924dfa53896c9.tar.gz nixlib-87bdd8565d5490e99c11b33782c924dfa53896c9.tar.bz2 nixlib-87bdd8565d5490e99c11b33782c924dfa53896c9.tar.lz nixlib-87bdd8565d5490e99c11b33782c924dfa53896c9.tar.xz nixlib-87bdd8565d5490e99c11b33782c924dfa53896c9.tar.zst nixlib-87bdd8565d5490e99c11b33782c924dfa53896c9.zip |
modules: use pkgs.substituteAll where applicable
I misread the implmentation, and thought it only worked for derivations that produced directories, so hadn't been using it until now.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/shell/git/default.nix | 18 | ||||
-rw-r--r-- | modules/workstation/mail/msmtp/default.nix | 7 | ||||
-rw-r--r-- | modules/workstation/windowing/sway/config.in | 4 | ||||
-rw-r--r-- | modules/workstation/windowing/sway/default.nix | 28 |
4 files changed, 28 insertions, 29 deletions
diff --git a/modules/shell/git/default.nix b/modules/shell/git/default.nix index 2f61a984aff3..8a7c10bfdb47 100644 --- a/modules/shell/git/default.nix +++ b/modules/shell/git/default.nix @@ -1,13 +1,13 @@ { pkgs, ... }: let - mozlz4_textconv = pkgs.runCommand "mozlz4-textconv" { + mozlz4_textconv = pkgs.substituteAll { + src = diff/mozlz4.in; + isExecutable = true; + inherit (pkgs) execline mozlz4a; python = pkgs.python3; - } '' - substituteAll ${diff/mozlz4.in} $out - chmod +x $out - ''; + }; # Git only supports absolute paths for this, so give it a wrapper # program that execs the msmtp in PATH. @@ -16,16 +16,16 @@ let msmtp $@ ''; - config = pkgs.runCommand "gitconfig" { + config = pkgs.substituteAll { + src = ./config.in; + inherit mozlz4_textconv; python = pkgs.python3; smtpServer = sendmail; attributesfile = ./attributes; ignorefile = ./ignore; preferLocalBuild = true; - } '' - substituteAll ${./config.in} $out - ''; + }; in { diff --git a/modules/workstation/mail/msmtp/default.nix b/modules/workstation/mail/msmtp/default.nix index 1648020c0633..34e23b1d1eb0 100644 --- a/modules/workstation/mail/msmtp/default.nix +++ b/modules/workstation/mail/msmtp/default.nix @@ -5,10 +5,9 @@ home.qyliss.dirs."state/msmtp" = {}; - xdg.config.users.qyliss.paths."msmtp/config" = pkgs.runCommand "msmtprc" { + xdg.config.users.qyliss.paths."msmtp/config" = pkgs.substituteAll { + src = ./msmtprc.in; inherit (pkgs) gnupg; tls_trust_file = "/etc/ssl/certs/ca-bundle.crt"; - } '' - substituteAll ${./msmtprc.in} $out - ''; + }; } diff --git a/modules/workstation/windowing/sway/config.in b/modules/workstation/windowing/sway/config.in index 7b4e44f5c350..4134f65c5b12 100644 --- a/modules/workstation/windowing/sway/config.in +++ b/modules/workstation/windowing/sway/config.in @@ -46,8 +46,8 @@ bindsym $mod+Shift+$down move down bindsym $mod+Shift+$up move up bindsym $mod+Shift+$right move right -bindsym $mod+g exec swaymsg workspace "$(@choose_workspace@)" -bindsym $mod+Shift+g exec swaymsg move container to workspace "$(@choose_workspace@)" +bindsym $mod+g exec swaymsg workspace "$(@choose_workspace@ | sed 's/\$/$$/g')" +bindsym $mod+Shift+g exec swaymsg move container to workspace "$(@choose_workspace@ | sed 's/\$/$$/g')" bindsym $mod+b splith bindsym $mod+v splitv diff --git a/modules/workstation/windowing/sway/default.nix b/modules/workstation/windowing/sway/default.nix index 4959b5164f01..f5c304e5d803 100644 --- a/modules/workstation/windowing/sway/default.nix +++ b/modules/workstation/windowing/sway/default.nix @@ -1,23 +1,23 @@ { pkgs, ... }: let - config = pkgs.runCommand "sway-config" { + config = pkgs.substituteAll { + src = ./config.in; inherit status_command choose_workspace; - } '' - substituteAll ${./config.in} $out - ''; + }; - status_command = with pkgs; - runCommand "status_command" { inherit execline; } '' - substituteAll ${./status_command.in} $out - chmod +x $out - ''; + status_command = pkgs.substituteAll { + src = ./status_command.in; + isExecutable = true; + inherit (pkgs) execline; + }; + + choose_workspace = pkgs.substituteAll { + src = ./choose_workspace.in; + isExecutable = true; + inherit (pkgs) execline jq; + }; - choose_workspace = with pkgs; - runCommand "choose_workspace" { inherit execline jq; } '' - substituteAll ${./choose_workspace.in} $out - chmod +x $out - ''; in { |