diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-10-22 19:33:45 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-10-22 19:33:45 +0200 |
commit | ddcc8c65e30a9ca3b56e25466e749cb100b28510 (patch) | |
tree | 869c782c4e5874d4d353d3cd82af5b0e2dfe9a45 /accounts/gkleen@sif/default.nix | |
parent | 0b7bd91465487426041c777a40de3be9f7407058 (diff) | |
download | nixos-ddcc8c65e30a9ca3b56e25466e749cb100b28510.tar nixos-ddcc8c65e30a9ca3b56e25466e749cb100b28510.tar.gz nixos-ddcc8c65e30a9ca3b56e25466e749cb100b28510.tar.bz2 nixos-ddcc8c65e30a9ca3b56e25466e749cb100b28510.tar.xz nixos-ddcc8c65e30a9ca3b56e25466e749cb100b28510.zip |
...
Diffstat (limited to 'accounts/gkleen@sif/default.nix')
-rw-r--r-- | accounts/gkleen@sif/default.nix | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 2cfaa620..842f7538 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix | |||
@@ -1,4 +1,7 @@ | |||
1 | { flake, flakeInputs, userName, pkgs, customUtils, lib, config, sources, ... }@inputs: | 1 | { flake, flakeInputs, userName, pkgs, customUtils, lib, config, sources, ... }@inputs: |
2 | |||
3 | with lib; | ||
4 | |||
2 | let | 5 | let |
3 | cfg = config.home-manager.users.${userName}; | 6 | cfg = config.home-manager.users.${userName}; |
4 | xmonad = import ./xmonad pkgs.haskell.packages.ghc8107; | 7 | xmonad = import ./xmonad pkgs.haskell.packages.ghc8107; |
@@ -29,16 +32,18 @@ let | |||
29 | --prefix PATH : ${pkgs.pulseaudio}/bin | 32 | --prefix PATH : ${pkgs.pulseaudio}/bin |
30 | ''; | 33 | ''; |
31 | }; | 34 | }; |
32 | wrapElectron = { package, bin ? package.meta.mainProgram or package.pname or (pkgs.lib.strings.nameFromURL package.name "-"), outBin ? bin }: pkgs.runCommand "${package.name}-wrapped" { buildInputs = with pkgs; [ makeWrapper ]; } '' | 35 | wrapElectron = { package, bin ? package.meta.mainProgram or package.pname or (pkgs.lib.strings.nameFromURL package.name "-"), outBin ? bin, sandbox ? true }: pkgs.runCommand "${package.name}-wrapped" { buildInputs = with pkgs; [ makeWrapper ]; } '' |
33 | mkdir -p "$out/bin" | 36 | mkdir -p "$out/bin" |
34 | makeWrapper ${package}/bin/${bin} $out/bin/${outBin} \ | 37 | makeWrapper ${package}/bin/${bin} $out/bin/${outBin} \ |
35 | --add-flags '--force-device-scale-factor=1.6' | 38 | --add-flags '--force-device-scale-factor=1.6' \ |
39 | ${optionalString (!sandbox) "--add-flags '--no-sandbox'"} | ||
36 | ''; | 40 | ''; |
37 | 41 | ||
38 | wrappedChrome = wrapElectron { package = pkgs.google-chrome; outBin = "google-chrome"; }; | 42 | wrappedChrome = wrapElectron { package = pkgs.google-chrome; outBin = "google-chrome"; }; |
39 | wrappedZulip = wrapElectron { package = pkgs.zulip; bin = "zulip"; outBin = "zulip"; }; | 43 | wrappedZulip = wrapElectron { package = pkgs.zulip; bin = "zulip"; outBin = "zulip"; }; |
40 | wrappedElementDesktop = wrapElectron { package = pkgs.element-desktop; bin = "element-desktop"; outBin = "element"; }; | 44 | wrappedElementDesktop = wrapElectron { package = pkgs.element-desktop; bin = "element-desktop"; outBin = "element"; }; |
41 | wrappedRocketChatDesktop = wrapElectron { package = pkgs.rocketchat-desktop; bin = "rocketchat-desktop"; outBin = "rocketchat"; }; | 45 | wrappedRocketChatDesktop = wrapElectron { package = pkgs.rocketchat-desktop; bin = "rocketchat-desktop"; outBin = "rocketchat"; }; |
46 | wrappedYTMDesktop = wrapElectron { package = pkgs.ytmdesktop; sandbox = false; }; | ||
42 | in { | 47 | in { |
43 | imports = with flake.nixosModules.userProfiles.${userName}; [ | 48 | imports = with flake.nixosModules.userProfiles.${userName}; [ |
44 | mpv yt-dlp (args: import ./xcompose.nix (inputs // args)) | 49 | mpv yt-dlp (args: import ./xcompose.nix (inputs // args)) |
@@ -47,7 +52,7 @@ in { | |||
47 | config = { | 52 | config = { |
48 | services.xserver = { | 53 | services.xserver = { |
49 | displayManager.defaultSession = "none+xmonad"; | 54 | displayManager.defaultSession = "none+xmonad"; |
50 | 55 | ||
51 | windowManager.session = [{ | 56 | windowManager.session = [{ |
52 | name = "xmonad"; | 57 | name = "xmonad"; |
53 | start = '' | 58 | start = '' |
@@ -155,7 +160,7 @@ in { | |||
155 | 160 | ||
156 | zsh.initExtra = "source ${./zshrc}"; | 161 | zsh.initExtra = "source ${./zshrc}"; |
157 | zsh.dirHashes = let | 162 | zsh.dirHashes = let |
158 | flakeHashes = lib.mapAttrs' (n: v: lib.nameValuePair (inputNames.${n} or n) (toString v)) flakeInputs; | 163 | flakeHashes = mapAttrs' (n: v: nameValuePair (inputNames.${n} or n) (toString v)) flakeInputs; |
159 | inputNames = { | 164 | inputNames = { |
160 | "nixpkgs" = "nixos"; | 165 | "nixpkgs" = "nixos"; |
161 | }; | 166 | }; |
@@ -193,7 +198,7 @@ in { | |||
193 | enable = true; | 198 | enable = true; |
194 | client = { | 199 | client = { |
195 | enable = true; | 200 | enable = true; |
196 | arguments = lib.mkForce ["-a" "\"\""]; | 201 | arguments = mkForce ["-a" "\"\""]; |
197 | }; | 202 | }; |
198 | }; | 203 | }; |
199 | gpg-agent = { | 204 | gpg-agent = { |
@@ -318,7 +323,7 @@ in { | |||
318 | fira fira-code powerline-fonts nerdfonts pavucontrol keepassxc | 323 | fira fira-code powerline-fonts nerdfonts pavucontrol keepassxc |
319 | sxiv xclip mumble pulseaudio-ctl pamixer libnotify synergy | 324 | sxiv xclip mumble pulseaudio-ctl pamixer libnotify synergy |
320 | xorg.xbacklight screen-message | 325 | xorg.xbacklight screen-message |
321 | ytmdesktop qt5ct playerctl evince | 326 | wrappedYTMDesktop qt5ct playerctl evince |
322 | thunderbird wrappedZulip zoom-us steam steam-run wireshark | 327 | thunderbird wrappedZulip zoom-us steam steam-run wireshark |
323 | virt-manager rclone cached-nix-shell xournal xmonad worktime | 328 | virt-manager rclone cached-nix-shell xournal xmonad worktime |
324 | fira-code-symbols libreoffice xournalpp wrappedChrome | 329 | fira-code-symbols libreoffice xournalpp wrappedChrome |
@@ -403,8 +408,8 @@ in { | |||
403 | defaultApplications = let | 408 | defaultApplications = let |
404 | filters = { | 409 | filters = { |
405 | }; | 410 | }; |
406 | filter = n: v: (filters.${n} or lib.id) (lib.filter (d: d != "emacs.desktop") v); | 411 | doFilter = n: v: (filters.${n} or id) (filter (d: d != "emacs.desktop") v); |
407 | in lib.mapAttrs filter (cfg.lib.xdg.mimeAssociations [ | 412 | in mapAttrs doFilter (cfg.lib.xdg.mimeAssociations [ |
408 | cfg.programs.zathura.package | 413 | cfg.programs.zathura.package |
409 | pkgs.sxiv | 414 | pkgs.sxiv |
410 | cfg.programs.emacs.package | 415 | cfg.programs.emacs.package |