All my system configs and packages in one repo
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

treewide: reformat with nixfmt-rfc-style

+1139 -843
+4 -7
flake.nix
··· 87 87 }; 88 88 }; 89 89 90 - outputs = inputs: 91 - inputs.flake-parts.lib.mkFlake 92 - {inherit inputs;} 93 - { 90 + outputs = 91 + inputs: 92 + inputs.flake-parts.lib.mkFlake { inherit inputs; } { 94 93 imports = [ 95 94 ./hm-plus 96 95 ./packages 97 96 ./systems 98 97 ]; 99 - systems = [ 100 - "x86_64-linux" 101 - ]; 98 + systems = [ "x86_64-linux" ]; 102 99 }; 103 100 }
+1 -1
hm-plus/default.nix
··· 1 1 { 2 2 flake.hmModules.hm-plus = { 3 - imports = [./modules]; 3 + imports = [ ./modules ]; 4 4 }; 5 5 }
+1 -5
hm-plus/modules/default.nix
··· 1 - { 2 - imports = [ 3 - ./programs 4 - ]; 5 - } 1 + { imports = [ ./programs ]; }
+37 -35
hm-plus/modules/programs/1password.nix
··· 3 3 pkgs, 4 4 config, 5 5 ... 6 - }: let 7 - inherit (lib) mkIf mkMerge mkOption mkEnableOption mkPackageOption optional; 6 + }: 7 + let 8 + inherit (lib) 9 + mkIf 10 + mkMerge 11 + mkOption 12 + mkEnableOption 13 + mkPackageOption 14 + optional 15 + ; 8 16 cfg = config.programs._1password; 9 17 10 - format = pkgs.formats.json {}; 18 + format = pkgs.formats.json { }; 11 19 12 20 # Converts an attrset like { p = 4; a.b.c = { d.e.f = 3; e = 5; }; } 13 21 # to another attrset like { p = 4; "a.b.c.d.e.f" = 3; "a.b.c.e" = 5; } 14 - pathify = let 15 - inherit (lib) flatten mapAttrsToList nameValuePair; 16 - inherit (builtins) isAttrs listToAttrs; 22 + pathify = 23 + let 24 + inherit (lib) flatten mapAttrsToList nameValuePair; 25 + inherit (builtins) isAttrs listToAttrs; 17 26 18 - pathify' = name: value: 19 - if isAttrs value 20 - then 21 - flatten (mapAttrsToList (n: 22 - pathify' ( 23 - if name != "" 24 - then "${name}.${n}" 25 - else n 26 - )) 27 - value) 28 - else [(nameValuePair name value)]; 29 - in 30 - v: 31 - if isAttrs v 32 - then listToAttrs (pathify' "" v) 33 - else v; 34 - in { 27 + pathify' = 28 + name: value: 29 + if isAttrs value then 30 + flatten (mapAttrsToList (n: pathify' (if name != "" then "${name}.${n}" else n)) value) 31 + else 32 + [ (nameValuePair name value) ]; 33 + in 34 + v: if isAttrs v then listToAttrs (pathify' "" v) else v; 35 + in 36 + { 35 37 options.programs._1password = { 36 38 enable = mkEnableOption "1Password"; 37 39 38 - package = mkPackageOption pkgs "1Password" { 39 - default = ["_1password-gui"]; 40 - }; 40 + package = mkPackageOption pkgs "1Password" { default = [ "_1password-gui" ]; }; 41 41 42 42 autostart = mkEnableOption "autostarting 1Password"; 43 43 44 44 settings = mkOption { 45 45 inherit (format) type; 46 - default = {}; 46 + default = { }; 47 47 description = '' 48 48 Configuration written to {file}`$XDG_CONFIG_HOME/1Password/settings/settings.json`. 49 49 ··· 60 60 config = mkIf cfg.enable (mkMerge [ 61 61 { 62 62 home.packages = 63 - [cfg.package] 64 - ++ optional cfg.autostart (pkgs.makeAutostartItem { 65 - name = "1password"; 66 - inherit (cfg) package; 67 - }); 63 + [ cfg.package ] 64 + ++ optional cfg.autostart ( 65 + pkgs.makeAutostartItem { 66 + name = "1password"; 67 + inherit (cfg) package; 68 + } 69 + ); 68 70 69 - xdg.configFile."1Password/settings/settings.json".source = format.generate "1password-settings.json" ( 70 - pathify ({version = 1;} // cfg.settings) 71 - ); 71 + xdg.configFile."1Password/settings/settings.json".source = 72 + format.generate "1password-settings.json" 73 + (pathify ({ version = 1; } // cfg.settings)); 72 74 } 73 75 (mkIf cfg.sshAgent.enable { 74 76 programs.git.signing.signer = lib.getExe cfg.package "op-ssh-sign";
+16 -9
hm-plus/modules/programs/discord.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: let 7 - inherit (lib) mkEnableOption mkPackageOption mkOption mkIf optionalAttrs types; 6 + }: 7 + let 8 + inherit (lib) 9 + mkEnableOption 10 + mkPackageOption 11 + mkOption 12 + mkIf 13 + optionalAttrs 14 + types 15 + ; 8 16 cfg = config.programs.discord; 9 - format = pkgs.formats.json {}; 10 - in { 17 + format = pkgs.formats.json { }; 18 + in 19 + { 11 20 options.programs.discord = { 12 21 enable = mkEnableOption "Discord"; 13 22 14 - package = mkPackageOption pkgs "Discord" { 15 - default = ["discord"]; 16 - }; 23 + package = mkPackageOption pkgs "Discord" { default = [ "discord" ]; }; 17 24 18 25 settings = mkOption { 19 26 inherit (format) type; 20 27 description = '' 21 28 Configuration written to {file}`$XDG_CONFIG_HOME/discord/settings.json`. 22 29 ''; 23 - default = {}; 30 + default = { }; 24 31 }; 25 32 26 33 openAsar.enable = mkEnableOption "OpenASAR"; ··· 33 40 description = '' 34 41 Configuration written to {file}`$XDG_CONFIG_HOME/Vencord/settings/settings.json`. 35 42 ''; 36 - default = {}; 43 + default = { }; 37 44 }; 38 45 39 46 css = mkOption {
+46 -45
hm-plus/modules/programs/fcitx5/default.nix
··· 4 4 lib, 5 5 pkgs, 6 6 ... 7 - }: let 8 - inherit (lib) mkMerge mkIf mkOption types literalExpression; 7 + }: 8 + let 9 + inherit (lib) 10 + mkMerge 11 + mkIf 12 + mkOption 13 + types 14 + literalExpression 15 + ; 9 16 im = config.i18n.inputMethod; 10 17 cfg = im.fcitx5; 11 18 12 19 fcitx5Package = 13 - if cfg.plasma6Support 14 - then pkgs.qt6Packages.fcitx5-with-addons.override {inherit (cfg) addons;} 15 - else pkgs.libsForQt5.fcitx5-with-addons; 20 + if cfg.plasma6Support then 21 + pkgs.qt6Packages.fcitx5-with-addons.override { inherit (cfg) addons; } 22 + else 23 + pkgs.libsForQt5.fcitx5-with-addons; 16 24 17 - fcitx5Package' = fcitx5Package.override {inherit (cfg) addons;}; 25 + fcitx5Package' = fcitx5Package.override { inherit (cfg) addons; }; 18 26 19 - format = pkgs.formats.ini {}; 20 - formatWithGlobalSection = pkgs.formats.iniWithGlobalSection {}; 21 - in { 22 - imports = [./rime.nix]; 27 + format = pkgs.formats.ini { }; 28 + formatWithGlobalSection = pkgs.formats.iniWithGlobalSection { }; 29 + in 30 + { 31 + imports = [ ./rime.nix ]; 23 32 24 33 options.i18n.inputMethod.fcitx5 = { 25 34 waylandFrontend = mkOption { ··· 41 50 }; 42 51 quickPhrase = mkOption { 43 52 type = with types; attrsOf str; 44 - default = {}; 53 + default = { }; 45 54 example = literalExpression '' 46 55 { 47 56 smile = "(・∀・)"; ··· 52 61 }; 53 62 quickPhraseFiles = mkOption { 54 63 type = with types; attrsOf path; 55 - default = {}; 64 + default = { }; 56 65 example = literalExpression '' 57 66 { 58 67 words = ./words.mb; ··· 63 72 }; 64 73 settings = { 65 74 globalOptions = mkOption { 66 - type = types.submodule { 67 - freeformType = format.type; 68 - }; 69 - default = {}; 75 + type = types.submodule { freeformType = format.type; }; 76 + default = { }; 70 77 description = '' 71 78 The global options in `config` file in ini format. 72 79 ''; 73 80 }; 74 81 inputMethod = mkOption { 75 - type = types.submodule { 76 - freeformType = format.type; 77 - }; 78 - default = {}; 82 + type = types.submodule { freeformType = format.type; }; 83 + default = { }; 79 84 description = '' 80 85 The input method configure in `profile` file in ini format. 81 86 ''; 82 87 }; 83 88 addons = mkOption { 84 89 type = with types; (attrsOf anything); 85 - default = {}; 90 + default = { }; 86 91 description = '' 87 92 The addon configures in `conf` folder in ini format with global sections. 88 93 Each item is written to the corresponding file. ··· 106 111 i18n.inputMethod.package = lib.mkForce fcitx5Package'; 107 112 108 113 i18n.inputMethod.fcitx5.addons = 109 - lib.optionals (cfg.quickPhrase != {}) [ 110 - (pkgs.writeTextDir "share/fcitx5/data/QuickPhrase.mb" 111 - (lib.concatStringsSep "\n" 112 - (lib.mapAttrsToList (name: value: "${name} ${value}") cfg.quickPhrase))) 114 + lib.optionals (cfg.quickPhrase != { }) [ 115 + (pkgs.writeTextDir "share/fcitx5/data/QuickPhrase.mb" ( 116 + lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "${name} ${value}") cfg.quickPhrase) 117 + )) 113 118 ] 114 - ++ lib.optionals (cfg.quickPhraseFiles != {}) [ 115 - (pkgs.linkFarm "quickPhraseFiles" (lib.mapAttrs' 116 - (name: value: lib.nameValuePair "share/fcitx5/data/quickphrase.d/${name}.mb" value) 117 - cfg.quickPhraseFiles)) 119 + ++ lib.optionals (cfg.quickPhraseFiles != { }) [ 120 + (pkgs.linkFarm "quickPhraseFiles" ( 121 + lib.mapAttrs' ( 122 + name: value: lib.nameValuePair "share/fcitx5/data/quickphrase.d/${name}.mb" value 123 + ) cfg.quickPhraseFiles 124 + )) 118 125 ]; 119 126 120 - xdg.configFile = let 121 - optionalFile = p: f: v: 122 - lib.optionalAttrs (v != {}) { 123 - "fcitx5/${p}".source = f p v; 124 - }; 125 - in 127 + xdg.configFile = 128 + let 129 + optionalFile = 130 + p: f: v: 131 + lib.optionalAttrs (v != { }) { "fcitx5/${p}".source = f p v; }; 132 + in 126 133 lib.attrsets.mergeAttrsList [ 127 134 (optionalFile "config" format cfg.settings.globalOptions) 128 135 (optionalFile "profile" format cfg.settings.inputMethod) 129 - (lib.concatMapAttrs 130 - (name: value: 131 - optionalFile 132 - "conf/${name}.conf" 133 - formatWithGlobalSection 134 - value) 135 - cfg.settings.addons) 136 + (lib.concatMapAttrs ( 137 + name: value: optionalFile "conf/${name}.conf" formatWithGlobalSection value 138 + ) cfg.settings.addons) 136 139 ]; 137 140 138 141 home.sessionVariables = mkMerge [ ··· 141 144 GTK_IM_MODULE = ""; 142 145 QT_IM_MODULE = ""; 143 146 }) 144 - (mkIf cfg.ignoreUserConfig { 145 - SKIP_FCITX_USER_PATH = "1"; 146 - }) 147 + (mkIf cfg.ignoreUserConfig { SKIP_FCITX_USER_PATH = "1"; }) 147 148 ]; 148 149 }; 149 150 }
+21 -19
hm-plus/modules/programs/fcitx5/rime.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: let 7 - inherit (lib) mkIf mkEnableOption mkOption mapAttrs' nameValuePair types; 6 + }: 7 + let 8 + inherit (lib) 9 + mkIf 10 + mkEnableOption 11 + mkOption 12 + mapAttrs' 13 + nameValuePair 14 + types 15 + ; 8 16 cfg = config.i18n.inputMethod.fcitx5.rime; 9 - format = pkgs.formats.yaml {}; 10 - in { 17 + format = pkgs.formats.yaml { }; 18 + in 19 + { 11 20 options.i18n.inputMethod.fcitx5.rime = { 12 21 enable = mkEnableOption "the Rime input engine for Fcitx5"; 13 22 14 23 dataPkgs = mkOption { 15 24 type = types.listOf types.package; 16 - default = [pkgs.rime-data]; 25 + default = [ pkgs.rime-data ]; 17 26 }; 18 27 19 28 settings = mkOption { 20 29 inherit (format) type; 21 - default = {}; 30 + default = { }; 22 31 example = { 23 32 default.patch.schema_list = [ 24 - {schema = "luna_pinyin_simp";} 25 - {schema = "luna_pinyin";} 33 + { schema = "luna_pinyin_simp"; } 34 + { schema = "luna_pinyin"; } 26 35 ]; 27 36 }; 28 37 }; 29 38 }; 30 39 31 40 config = mkIf cfg.enable { 32 - i18n.inputMethod.fcitx5.addons = [ 33 - (pkgs.fcitx5-rime.override { 34 - rimeDataPkgs = cfg.dataPkgs; 35 - }) 36 - ]; 37 - xdg.dataFile = 38 - mapAttrs' ( 39 - n: v: 40 - nameValuePair "fcitx5/rime/${n}.custom.yaml" {source = format.generate n v;} 41 - ) 42 - cfg.settings; 41 + i18n.inputMethod.fcitx5.addons = [ (pkgs.fcitx5-rime.override { rimeDataPkgs = cfg.dataPkgs; }) ]; 42 + xdg.dataFile = mapAttrs' ( 43 + n: v: nameValuePair "fcitx5/rime/${n}.custom.yaml" { source = format.generate n v; } 44 + ) cfg.settings; 43 45 }; 44 46 }
+16 -4
hm-plus/modules/programs/git.nix
··· 3 3 pkgs, 4 4 config, 5 5 ... 6 - }: let 7 - inherit (lib) getExe getExe' mkIf mkOption types; 6 + }: 7 + let 8 + inherit (lib) 9 + getExe 10 + getExe' 11 + mkIf 12 + mkOption 13 + types 14 + ; 8 15 cfg = config.programs.git; 9 - in { 16 + in 17 + { 10 18 options.programs.git = { 11 19 signingFormat = mkOption { 12 - type = types.enum ["openpgp" "ssh" "x509"]; 20 + type = types.enum [ 21 + "openpgp" 22 + "ssh" 23 + "x509" 24 + ]; 13 25 default = "openpgp"; 14 26 }; 15 27
+16 -12
hm-plus/modules/programs/vesktop.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: let 7 - inherit (lib) mkEnableOption mkPackageOption mkOption mkIf types; 6 + }: 7 + let 8 + inherit (lib) 9 + mkEnableOption 10 + mkPackageOption 11 + mkOption 12 + mkIf 13 + types 14 + ; 8 15 cfg = config.programs.vesktop; 9 - format = pkgs.formats.json {}; 10 - in { 16 + format = pkgs.formats.json { }; 17 + in 18 + { 11 19 options.programs.vesktop = { 12 20 enable = mkEnableOption "Vesktop"; 13 21 14 - package = mkPackageOption pkgs "Vesktop" { 15 - default = ["vesktop"]; 16 - }; 22 + package = mkPackageOption pkgs "Vesktop" { default = [ "vesktop" ]; }; 17 23 18 24 settings = mkOption { 19 25 inherit (format) type; 20 26 description = '' 21 27 Configuration written to {file}`$XDG_CONFIG_HOME/vesktop/settings.json`. 22 28 ''; 23 - default = {}; 29 + default = { }; 24 30 }; 25 31 26 32 vencord = { ··· 35 41 description = '' 36 42 Configuration of the bundled client mod, Vencord, written to {file}`$XDG_CONFIG_HOME/vesktop/settings/settings.json`. 37 43 ''; 38 - default = {}; 44 + default = { }; 39 45 }; 40 46 41 47 css = mkOption { ··· 49 55 }; 50 56 51 57 config = mkIf cfg.enable { 52 - home.packages = [ 53 - (cfg.package.override {withSystemVencord = cfg.vencord.useSystemPackage;}) 54 - ]; 58 + home.packages = [ (cfg.package.override { withSystemVencord = cfg.vencord.useSystemPackage; }) ]; 55 59 56 60 xdg.configFile = { 57 61 "vesktop/settings.json".source = format.generate "vesktop-settings.json" cfg.settings;
+1 -4
packages/catppuccin-fcitx5/default.nix
··· 1 - { 2 - stdenvNoCC, 3 - fetchFromGitHub, 4 - }: 1 + { stdenvNoCC, fetchFromGitHub }: 5 2 stdenvNoCC.mkDerivation { 6 3 pname = "catppuccin-fcitx5"; 7 4 version = "2022-10-05";
+28 -21
packages/catppuccin-konsole/default.nix
··· 2 2 lib, 3 3 stdenvNoCC, 4 4 fetchFromGitHub, 5 - flavors ? [], 6 - }: let 7 - validFlavors = ["mocha" "macchiato" "frappe" "latte"]; 8 - mkUpper = str: 9 - with builtins; 10 - (lib.toUpper (substring 0 1 str)) + (substring 1 (stringLength str) str); 5 + flavors ? [ ], 6 + }: 7 + let 8 + validFlavors = [ 9 + "mocha" 10 + "macchiato" 11 + "frappe" 12 + "latte" 13 + ]; 14 + mkUpper = 15 + str: with builtins; (lib.toUpper (substring 0 1 str)) + (substring 1 (stringLength str) str); 11 16 in 12 - # 13 - lib.checkListOfEnum "Invalid flavor, valid flavors are ${toString validFlavors}" validFlavors flavors 14 - stdenvNoCC.mkDerivation { 17 + # 18 + lib.checkListOfEnum "Invalid flavor, valid flavors are ${toString validFlavors}" validFlavors 19 + flavors 20 + stdenvNoCC.mkDerivation 21 + { 15 22 pname = "catppuccin-konsole"; 16 23 version = "2022-11-09"; 17 24 ··· 22 29 hash = "sha256-EwSJMTxnaj2UlNJm1t6znnatfzgm1awIQQUF3VPfCTM="; 23 30 }; 24 31 25 - installPhase = let 26 - flavoursToInstall = builtins.concatStringsSep " " (map (x: "Catppuccin-${mkUpper x}.colorscheme") ( 27 - if flavors == [] 28 - then ["*"] 29 - else flavors 30 - )); 31 - in '' 32 - runHook preInstall 32 + installPhase = 33 + let 34 + flavoursToInstall = builtins.concatStringsSep " " ( 35 + map (x: "Catppuccin-${mkUpper x}.colorscheme") (if flavors == [ ] then [ "*" ] else flavors) 36 + ); 37 + in 38 + '' 39 + runHook preInstall 33 40 34 - mkdir -p $out/share/konsole/ 35 - cp -r ${flavoursToInstall} $out/share/konsole/ 41 + mkdir -p $out/share/konsole/ 42 + cp -r ${flavoursToInstall} $out/share/konsole/ 36 43 37 - runHook postInstall 38 - ''; 44 + runHook postInstall 45 + ''; 39 46 }
+25 -17
packages/catppuccin-sddm/default.nix
··· 2 2 lib, 3 3 stdenvNoCC, 4 4 fetchFromGitHub, 5 - flavors ? [], 6 - }: let 7 - validFlavors = ["mocha" "macchiato" "frappe" "latte"]; 5 + flavors ? [ ], 6 + }: 7 + let 8 + validFlavors = [ 9 + "mocha" 10 + "macchiato" 11 + "frappe" 12 + "latte" 13 + ]; 8 14 in 9 - lib.checkListOfEnum "Invalid flavor, valid flavors are ${toString validFlavors}" validFlavors flavors 10 - stdenvNoCC.mkDerivation { 15 + lib.checkListOfEnum "Invalid flavor, valid flavors are ${toString validFlavors}" validFlavors 16 + flavors 17 + stdenvNoCC.mkDerivation 18 + { 11 19 pname = "catppuccin-sddm"; 12 20 version = "2023-12-05"; 13 21 ··· 18 26 hash = "sha256-Jf4xfgJEzLM7WiVsERVkj5k80Fhh1edUl6zsSBbQi6Y="; 19 27 }; 20 28 21 - installPhase = let 22 - flavoursToInstall = builtins.concatStringsSep " " (map (x: "src/catppuccin-${x}") ( 23 - if flavors == [] 24 - then ["*"] 25 - else flavors 26 - )); 27 - in '' 28 - runHook preInstall 29 + installPhase = 30 + let 31 + flavoursToInstall = builtins.concatStringsSep " " ( 32 + map (x: "src/catppuccin-${x}") (if flavors == [ ] then [ "*" ] else flavors) 33 + ); 34 + in 35 + '' 36 + runHook preInstall 29 37 30 - mkdir -p $out/share/sddm/themes/ 31 - cp -r ${flavoursToInstall} $out/share/sddm/themes/ 38 + mkdir -p $out/share/sddm/themes/ 39 + cp -r ${flavoursToInstall} $out/share/sddm/themes/ 32 40 33 - runHook postInstall 34 - ''; 41 + runHook postInstall 42 + ''; 35 43 }
+5 -3
packages/default.nix
··· 1 1 { 2 - perSystem = {pkgs, ...}: { 3 - packages = import ./packages.nix {inherit pkgs;}; 4 - }; 2 + perSystem = 3 + { pkgs, ... }: 4 + { 5 + packages = import ./packages.nix { inherit pkgs; }; 6 + }; 5 7 }
+1 -1
packages/overlay.nix
··· 1 - _: prev: import ./packages.nix {pkgs = prev;} 1 + _: prev: import ./packages.nix { pkgs = prev; }
+6 -5
packages/packages.nix
··· 1 - {pkgs, ...}: { 2 - catppuccin-fcitx5 = pkgs.callPackage ./catppuccin-fcitx5 {}; 3 - catppuccin-sddm = pkgs.callPackage ./catppuccin-sddm {}; 4 - catppuccin-konsole = pkgs.callPackage ./catppuccin-konsole {}; 5 - rethink-sans = pkgs.callPackage ./rethink-sans {}; 1 + { pkgs, ... }: 2 + { 3 + catppuccin-fcitx5 = pkgs.callPackage ./catppuccin-fcitx5 { }; 4 + catppuccin-sddm = pkgs.callPackage ./catppuccin-sddm { }; 5 + catppuccin-konsole = pkgs.callPackage ./catppuccin-konsole { }; 6 + rethink-sans = pkgs.callPackage ./rethink-sans { }; 6 7 }
+1 -1
packages/rethink-sans/default.nix
··· 24 24 description = "A humble open source font built on the shoulders of DM Sans and Poppins"; 25 25 homepage = "https://github.com/hans-thiessen/Rethink-Sans"; 26 26 license = lib.licenses.ofl; 27 - maintainers = with lib.maintainers; [pluiedev]; 27 + maintainers = with lib.maintainers; [ pluiedev ]; 28 28 platforms = lib.platforms.all; 29 29 }; 30 30 }
+7 -3
roles/audio/default.nix
··· 1 - {lib, ...}: let 1 + { lib, ... }: 2 + let 2 3 inherit (lib) mkEnableOption; 3 - in { 4 - options.roles.audio.enable = mkEnableOption "audio support" // {default = true;}; 4 + in 5 + { 6 + options.roles.audio.enable = mkEnableOption "audio support" // { 7 + default = true; 8 + }; 5 9 }
+5 -7
roles/audio/nixos.nix
··· 1 - { 2 - config, 3 - lib, 4 - ... 5 - }: let 1 + { config, lib, ... }: 2 + let 6 3 cfg = config.roles.audio; 7 4 inherit (lib) mkIf; 8 - in { 5 + in 6 + { 9 7 config = mkIf cfg.enable { 10 8 sound.enable = true; 11 9 hardware.pulseaudio.enable = false; 12 10 security.rtkit.enable = true; 13 11 14 - roles.base.user.extraGroups = ["rtkit"]; 12 + roles.base.user.extraGroups = [ "rtkit" ]; 15 13 16 14 services.pipewire = { 17 15 enable = true;
+28 -9
roles/base/default.nix
··· 1 - { 2 - config, 3 - lib, 4 - ... 5 - }: let 6 - inherit (lib) mkAliasOptionModule mkEnableOption mkOption types optional; 1 + { config, lib, ... }: 2 + let 3 + inherit (lib) 4 + mkAliasOptionModule 5 + mkEnableOption 6 + mkOption 7 + types 8 + optional 9 + ; 7 10 8 11 cfg = config.roles.base; 9 - in { 12 + in 13 + { 10 14 options.roles.base = { 11 15 username = mkOption { 12 16 type = types.str; ··· 30 34 }; 31 35 32 36 imports = [ 33 - (mkAliasOptionModule ["hm"] ["home-manager" "users" cfg.username]) 34 - (mkAliasOptionModule ["roles" "base" "user"] ["users" "users" cfg.username]) 37 + (mkAliasOptionModule [ "hm" ] [ 38 + "home-manager" 39 + "users" 40 + cfg.username 41 + ]) 42 + (mkAliasOptionModule 43 + [ 44 + "roles" 45 + "base" 46 + "user" 47 + ] 48 + [ 49 + "users" 50 + "users" 51 + cfg.username 52 + ] 53 + ) 35 54 ]; 36 55 37 56 config = {
+4 -6
roles/base/nixos.nix
··· 1 - { 2 - config, 3 - lib, 4 - ... 5 - }: let 1 + { config, lib, ... }: 2 + let 6 3 inherit (lib.lists) optional; 7 4 8 5 cfg = config.roles.base; 9 - in { 6 + in 7 + { 10 8 config = { 11 9 roles.base.user = { 12 10 isNormalUser = true;
+11 -5
roles/boot/default.nix
··· 1 - {lib, ...}: let 1 + { lib, ... }: 2 + let 2 3 inherit (lib) mkEnableOption; 3 - in { 4 - imports = [./lanzaboote]; 4 + in 5 + { 6 + imports = [ ./lanzaboote ]; 5 7 6 8 options.roles.boot = { 7 - enable = mkEnableOption "boot settings" // {default = true;}; 9 + enable = mkEnableOption "boot settings" // { 10 + default = true; 11 + }; 8 12 9 - patch.fix-246195.enable = mkEnableOption "patch for Nixpkgs issue #246195" // {default = true;}; 13 + patch.fix-246195.enable = mkEnableOption "patch for Nixpkgs issue #246195" // { 14 + default = true; 15 + }; 10 16 }; 11 17 }
+30 -27
roles/boot/fix-246195/default.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 - with lib; let 7 + with lib; 8 + let 8 9 cfg = config.boot.loader.systemd-boot; 9 - python3 = pkgs.python3.withPackages (ps: [ps.packaging]); 10 + python3 = pkgs.python3.withPackages (ps: [ ps.packaging ]); 10 11 11 12 systemdBootBuilder = pkgs.substituteAll { 12 13 src = ./systemd-boot-builder.py; ··· 16 17 systemd = config.systemd.package; 17 18 nix = config.nix.package.out; 18 19 timeout = optionalString (config.boot.loader.timeout != null) config.boot.loader.timeout; 19 - editor = 20 - if cfg.editor 21 - then "True" 22 - else "False"; 23 - configurationLimit = 24 - if cfg.configurationLimit != null 25 - then cfg.configurationLimit 26 - else 0; 20 + editor = if cfg.editor then "True" else "False"; 21 + configurationLimit = if cfg.configurationLimit != null then cfg.configurationLimit else 0; 27 22 28 23 inherit (cfg) consoleMode graceful; 29 24 inherit (config.boot.loader.efi) efiSysMountPoint canTouchEfiVariables; ··· 35 30 copyExtraFiles = pkgs.writeShellScript "copy-extra-files" '' 36 31 empty_file=$(${pkgs.coreutils}/bin/mktemp) 37 32 38 - ${concatStrings (mapAttrsToList (n: v: '' 33 + ${concatStrings ( 34 + mapAttrsToList (n: v: '' 39 35 ${pkgs.coreutils}/bin/install -Dp "${v}" "${efiSysMountPoint}/"${escapeShellArg n} 40 36 ${pkgs.coreutils}/bin/install -D $empty_file "${efiSysMountPoint}/efi/nixos/.extra-files/"${escapeShellArg n} 41 - '') 42 - cfg.extraFiles)} 37 + '') cfg.extraFiles 38 + )} 43 39 44 - ${concatStrings (mapAttrsToList (n: v: '' 40 + ${concatStrings ( 41 + mapAttrsToList (n: v: '' 45 42 ${pkgs.coreutils}/bin/install -Dp "${pkgs.writeText n v}" "${efiSysMountPoint}/loader/entries/"${escapeShellArg n} 46 43 ${pkgs.coreutils}/bin/install -D $empty_file "${efiSysMountPoint}/efi/nixos/.extra-files/loader/entries/"${escapeShellArg n} 47 - '') 48 - cfg.extraEntries)} 44 + '') cfg.extraEntries 45 + )} 49 46 ''; 50 47 }; 51 48 52 49 checkedSystemdBootBuilder = 53 - pkgs.runCommand "systemd-boot" { 54 - nativeBuildInputs = [pkgs.mypy python3]; 55 - } '' 56 - install -m755 ${systemdBootBuilder} $out 57 - mypy \ 58 - --no-implicit-optional \ 59 - --disallow-untyped-calls \ 60 - --disallow-untyped-defs \ 61 - $out 62 - ''; 50 + pkgs.runCommand "systemd-boot" 51 + { 52 + nativeBuildInputs = [ 53 + pkgs.mypy 54 + python3 55 + ]; 56 + } 57 + '' 58 + install -m755 ${systemdBootBuilder} $out 59 + mypy \ 60 + --no-implicit-optional \ 61 + --disallow-untyped-calls \ 62 + --disallow-untyped-defs \ 63 + $out 64 + ''; 63 65 64 66 finalSystemdBootBuilder = pkgs.writeScript "install-systemd-boot.sh" '' 65 67 #!${pkgs.runtimeShell} 66 68 ${checkedSystemdBootBuilder} "$@" 67 69 ${cfg.extraInstallCommands} 68 70 ''; 69 - in { 71 + in 72 + { 70 73 config = lib.mkIf config.roles.boot.patch.fix-246195.enable { 71 74 system.build.installBootLoader = lib.mkForce finalSystemdBootBuilder; 72 75 };
+3 -2
roles/boot/lanzaboote/default.nix
··· 3 3 lib, 4 4 inputs, 5 5 ... 6 - }: { 7 - imports = [inputs.lanzaboote.nixosModules.lanzaboote]; 6 + }: 7 + { 8 + imports = [ inputs.lanzaboote.nixosModules.lanzaboote ]; 8 9 9 10 options.roles.boot.lanzaboote.enable = lib.mkEnableOption "Lanzaboote, a secure boot implementation for NixOS"; 10 11
+5 -7
roles/boot/nixos.nix
··· 1 - { 2 - config, 3 - lib, 4 - ... 5 - }: let 1 + { config, lib, ... }: 2 + let 6 3 cfg = config.roles.boot; 7 - in { 8 - imports = [./fix-246195]; 4 + in 5 + { 6 + imports = [ ./fix-246195 ]; 9 7 10 8 config = lib.mkIf cfg.enable { 11 9 boot.loader = {
+33 -6
roles/catppuccin/default.nix
··· 3 3 lib, 4 4 inputs, 5 5 ... 6 - }: let 7 - inherit (lib) mkEnableOption mkIf mkOption types; 6 + }: 7 + let 8 + inherit (lib) 9 + mkEnableOption 10 + mkIf 11 + mkOption 12 + types 13 + ; 8 14 inherit (config.roles.catppuccin) enable flavour accent; 9 - in { 15 + in 16 + { 10 17 imports = [ 11 18 inputs.catppuccin.nixosModules.catppuccin 12 19 ./discord.nix ··· 17 24 enable = mkEnableOption "Catppuccin"; 18 25 19 26 flavour = mkOption { 20 - type = types.enum ["latte" "frappe" "macchiato" "mocha"]; 27 + type = types.enum [ 28 + "latte" 29 + "frappe" 30 + "macchiato" 31 + "mocha" 32 + ]; 21 33 example = "mocha"; 22 34 }; 23 35 accent = mkOption { 24 - type = types.enum ["rosewater" "flamingo" "pink" "mauve" "red" "maroon" "peach" "yellow" "green" "teal" "sky" "sapphire" "blue" "lavender"]; 36 + type = types.enum [ 37 + "rosewater" 38 + "flamingo" 39 + "pink" 40 + "mauve" 41 + "red" 42 + "maroon" 43 + "peach" 44 + "yellow" 45 + "green" 46 + "teal" 47 + "sky" 48 + "sapphire" 49 + "blue" 50 + "lavender" 51 + ]; 25 52 example = "maroon"; 26 53 }; 27 54 }; ··· 32 59 enable = true; 33 60 }; 34 61 hm = { 35 - imports = [inputs.catppuccin.homeManagerModules.catppuccin]; 62 + imports = [ inputs.catppuccin.homeManagerModules.catppuccin ]; 36 63 37 64 catppuccin = { 38 65 inherit accent flavour;
+13 -5
roles/catppuccin/discord.nix
··· 3 3 lib, 4 4 inputs, 5 5 ... 6 - }: let 6 + }: 7 + let 7 8 inherit (lib) mkEnableOption mkIf; 8 9 inherit (config.roles.catppuccin) enable flavour accent; 9 10 cfg = config.hm.programs.discord.catppuccin; 10 11 11 12 vencord.settings = { 12 - themeLinks = ["https://raw.githubusercontent.com/catppuccin/discord/${inputs.ctp-discord-compiled.rev}/dist/catppuccin-${flavour}-${accent}.theme.css"]; 13 + themeLinks = [ 14 + "https://raw.githubusercontent.com/catppuccin/discord/${inputs.ctp-discord-compiled.rev}/dist/catppuccin-${flavour}-${accent}.theme.css" 15 + ]; 13 16 14 17 plugins.ShikiCodeblocks.theme = "https://raw.githubusercontent.com/catppuccin/vscode/${inputs.ctp-vscode-compiled.rev}/${flavour}.json"; 15 18 }; 16 - in { 19 + in 20 + { 17 21 # TODO: make these "catppuccin-plus" options 18 22 #options.hm.programs.discord.catppuccin.enable = mkEnableOption "Catppuccin theme" // {default = enable;}; 19 23 20 24 # Reproducible 🔥🚀 tracking of latest theme version 21 - hm.programs.discord = {inherit vencord;}; 22 - hm.programs.vesktop = {inherit vencord;}; 25 + hm.programs.discord = { 26 + inherit vencord; 27 + }; 28 + hm.programs.vesktop = { 29 + inherit vencord; 30 + }; 23 31 }
+29 -25
roles/catppuccin/nixos.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: let 6 + }: 7 + let 7 8 inherit (config.roles.catppuccin) enable flavour accent; 8 9 9 - mkUpper = str: 10 - with builtins; 11 - (lib.toUpper (substring 0 1 str)) + (substring 1 (stringLength str) str); 10 + mkUpper = 11 + str: with builtins; (lib.toUpper (substring 0 1 str)) + (substring 1 (stringLength str) str); 12 12 Flavour = mkUpper flavour; 13 - in { 13 + in 14 + { 14 15 config = lib.mkIf enable { 15 16 hm.gtk = { 16 17 enable = true; 17 18 catppuccin = { 18 19 enable = true; 19 - tweaks = ["rimless"]; 20 + tweaks = [ "rimless" ]; 20 21 size = "compact"; 21 22 cursor.enable = true; 22 23 }; ··· 28 29 29 30 console.catppuccin.enable = true; 30 31 31 - roles.qt = let 32 - common.settings.Appearance = { 33 - color_scheme_path = "${pkgs.catppuccin-qt5ct}/share/qt5ct/colors/Catppuccin-${Flavour}.conf"; 34 - custom_palette = true; 35 - }; 36 - in 37 - lib.genAttrs ["qt5ct" "qt6ct"] (_: common); 32 + roles.qt = 33 + let 34 + common.settings.Appearance = { 35 + color_scheme_path = "${pkgs.catppuccin-qt5ct}/share/qt5ct/colors/Catppuccin-${Flavour}.conf"; 36 + custom_palette = true; 37 + }; 38 + in 39 + lib.genAttrs [ 40 + "qt5ct" 41 + "qt6ct" 42 + ] (_: common); 38 43 39 44 # TODO: figure out how to apply this via plasmarc 40 - hm.home.packages = let 41 - plasmaEnabled = config.services.desktopManager.plasma6.enable; 42 - in 43 - lib.optional plasmaEnabled (pkgs.catppuccin-kde.override { 44 - flavour = [flavour]; 45 - accents = [accent]; 46 - }) 47 - ++ [ 48 - (pkgs.catppuccin-konsole.override { 49 - flavors = [flavour]; 50 - }) 51 - ]; 45 + hm.home.packages = 46 + let 47 + plasmaEnabled = config.services.desktopManager.plasma6.enable; 48 + in 49 + lib.optional plasmaEnabled ( 50 + pkgs.catppuccin-kde.override { 51 + flavour = [ flavour ]; 52 + accents = [ accent ]; 53 + } 54 + ) 55 + ++ [ (pkgs.catppuccin-konsole.override { flavors = [ flavour ]; }) ]; 52 56 }; 53 57 }
+8 -8
roles/catppuccin/sddm.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: let 6 + }: 7 + let 7 8 inherit (lib) mkEnableOption mkIf; 8 9 inherit (config.roles.catppuccin) enable flavour; 9 10 cfg = config.services.displayManager.sddm.catppuccin; 10 - in { 11 - options.services.displayManager.sddm.catppuccin.enable = mkEnableOption "Catppuccin theme" // {default = enable;}; 11 + in 12 + { 13 + options.services.displayManager.sddm.catppuccin.enable = mkEnableOption "Catppuccin theme" // { 14 + default = enable; 15 + }; 12 16 13 17 config = mkIf cfg.enable { 14 - environment.systemPackages = [ 15 - (pkgs.catppuccin-sddm.override { 16 - flavors = [flavour]; 17 - }) 18 - ]; 18 + environment.systemPackages = [ (pkgs.catppuccin-sddm.override { flavors = [ flavour ]; }) ]; 19 19 20 20 services.displayManager.sddm.theme = "catppuccin-${flavour}"; 21 21 };
+3 -2
roles/darwin.nix
··· 1 - inputs @ {lib, ...}: { 1 + inputs@{ lib, ... }: 2 + { 2 3 imports = 3 - [./.] 4 + [ ./. ] 4 5 ++ (lib.pipe (import ./. inputs).imports [ 5 6 (map (s: /${s}/darwin.nix)) 6 7 (builtins.filter builtins.pathExists)
+2 -1
roles/default.nix
··· 1 - {lib, ...}: { 1 + { lib, ... }: 2 + { 2 3 imports = lib.pipe ./. [ 3 4 builtins.readDir 4 5 (lib.filterAttrs (n: ty: ty == "directory" && builtins.pathExists ./${n}/default.nix))
+18 -20
roles/email/default.nix
··· 1 - { 2 - config, 3 - lib, 4 - ... 5 - }: let 1 + { config, lib, ... }: 2 + let 6 3 cfg = config.roles.email; 7 - inherit (lib) mkEnableOption mkIf mkOption types; 4 + inherit (lib) 5 + mkEnableOption 6 + mkIf 7 + mkOption 8 + types 9 + ; 8 10 9 11 serverModule.options = { 10 12 host = mkOption { ··· 42 44 type = types.str; 43 45 example = "Leah"; 44 46 }; 45 - host = mkOption { 46 - type = types.submodule hostModule; 47 - }; 47 + host = mkOption { type = types.submodule hostModule; }; 48 48 }; 49 - in { 49 + in 50 + { 50 51 options.roles.email = { 51 52 enable = mkEnableOption "E-Mail configurations"; 52 53 53 54 accounts = mkOption { 54 55 type = types.attrsOf (types.submodule emailModule); 55 - default = {}; 56 + default = { }; 56 57 }; 57 58 }; 58 59 59 - config.hm.accounts.email = let 60 - accounts = 61 - builtins.mapAttrs (address: account: rec { 60 + config.hm.accounts.email = 61 + let 62 + accounts = builtins.mapAttrs (address: account: rec { 62 63 inherit (account) primary realName; 63 64 inherit (account.host) imap smtp; 64 65 inherit address; 65 66 userName = address; # Use the address as the IMAP/SMTP username by default 66 67 thunderbird.enable = true; 67 - }) 68 - cfg.accounts; 69 - in 70 - mkIf cfg.enable { 71 - inherit accounts; 72 - }; 68 + }) cfg.accounts; 69 + in 70 + mkIf cfg.enable { inherit accounts; }; 73 71 }
+2 -1
roles/fish/default.nix
··· 1 - {lib, ...}: { 1 + { lib, ... }: 2 + { 2 3 options.roles.fish = { 3 4 enable = lib.mkEnableOption "Fish shell"; 4 5 defaultShell = lib.mkEnableOption "Fish shell as the user's default shell";
+4 -2
roles/fish/nixos.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: let 6 + }: 7 + let 7 8 inherit (lib) mkIf; 8 9 cfg = config.roles.fish; 9 - in { 10 + in 11 + { 10 12 config = mkIf cfg.enable { 11 13 programs.fish.enable = true; 12 14 hm.programs.fish.enable = true;
+5 -9
roles/fonts/darwin.nix
··· 1 - { 2 - config, 3 - lib, 4 - ... 5 - }: let 1 + { config, lib, ... }: 2 + let 6 3 cfg = config.roles.fonts; 7 4 inherit (lib) mkIf; 8 - in { 9 - config = mkIf cfg.enable { 10 - fonts.fonts = cfg.packages; 11 - }; 5 + in 6 + { 7 + config = mkIf cfg.enable { fonts.fonts = cfg.packages; }; 12 8 }
+6 -4
roles/fonts/default.nix
··· 1 - {lib, ...}: let 1 + { lib, ... }: 2 + let 2 3 inherit (lib) mkEnableOption mkOption types; 3 - in { 4 + in 5 + { 4 6 options.roles.fonts = { 5 7 enable = mkEnableOption "default fonts"; 6 8 packages = mkOption { 7 9 type = types.listOf types.package; 8 - default = []; 10 + default = [ ]; 9 11 }; 10 12 defaults = mkOption { 11 13 type = types.attrsOf (types.listOf types.str); 12 - default = {}; 14 + default = { }; 13 15 }; 14 16 }; 15 17 }
+4 -6
roles/fonts/nixos.nix
··· 1 - { 2 - config, 3 - lib, 4 - ... 5 - }: let 1 + { config, lib, ... }: 2 + let 6 3 cfg = config.roles.fonts; 7 4 inherit (lib) mkIf; 8 - in { 5 + in 6 + { 9 7 config = mkIf cfg.enable { 10 8 fonts = { 11 9 inherit (cfg) packages;
+4 -2
roles/hyprland/default.nix
··· 1 - {lib, ...}: let 1 + { lib, ... }: 2 + let 2 3 inherit (lib) mkEnableOption; 3 - in { 4 + in 5 + { 4 6 options.roles.hyprland = { 5 7 enable = mkEnableOption "Hyprland"; 6 8 };
+19 -4
roles/hyprland/nixos.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: let 6 + }: 7 + let 7 8 inherit (lib) mkIf mkAliasOptionModule; 8 9 cfg = config.roles.hyprland; 9 - in { 10 + in 11 + { 10 12 imports = [ 11 - (mkAliasOptionModule ["roles" "hyprland" "settings"] ["hm" "wayland" "windowManager" "hyprland" "settings"]) 13 + (mkAliasOptionModule 14 + [ 15 + "roles" 16 + "hyprland" 17 + "settings" 18 + ] 19 + [ 20 + "hm" 21 + "wayland" 22 + "windowManager" 23 + "hyprland" 24 + "settings" 25 + ] 26 + ) 12 27 ]; 13 28 14 29 config = mkIf cfg.enable { ··· 22 37 xwayland.enable = true; 23 38 }; 24 39 25 - hm.home.packages = [pkgs.wl-clipboard]; 40 + hm.home.packages = [ pkgs.wl-clipboard ]; 26 41 }; 27 42 }
+23 -13
roles/mirrors/default.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: let 7 - inherit (lib) mkEnableOption mkIf mkOption types flip; 6 + }: 7 + let 8 + inherit (lib) 9 + mkEnableOption 10 + mkIf 11 + mkOption 12 + types 13 + flip 14 + ; 8 15 inherit (builtins) hasAttr mapAttrs; 9 16 10 17 cfg = config.roles.mirrors; 11 18 defaultSite = cfg.chinese.sites.${cfg.chinese.defaultSite}; 12 - in { 19 + in 20 + { 13 21 options.roles.mirrors.chinese = { 14 22 enable = mkEnableOption "Chinese mirror sites to speed up downloads in Mainland China"; 15 23 16 24 defaultSite = mkOption { 17 - type = types.str // {check = flip hasAttr cfg.chinese.sites;}; 25 + type = types.str // { 26 + check = flip hasAttr cfg.chinese.sites; 27 + }; 18 28 19 29 default = "sjtu"; 20 30 }; ··· 32 42 33 43 config = mkIf cfg.chinese.enable { 34 44 roles.rust = { 35 - rust-bin = 36 - pkgs.rust-bin 37 - // { 38 - distRoot = "${defaultSite}/rust-static/dist"; 39 - }; 45 + rust-bin = pkgs.rust-bin // { 46 + distRoot = "${defaultSite}/rust-static/dist"; 47 + }; 40 48 41 - settings.source = 42 - {crates-io.replace-with = cfg.chinese.defaultSite;} 43 - // mapAttrs (_: url: "sparse+${url}/crates.io-index") cfg.chinese.sites; 49 + settings.source = { 50 + crates-io.replace-with = cfg.chinese.defaultSite; 51 + } // mapAttrs (_: url: "sparse+${url}/crates.io-index") cfg.chinese.sites; 44 52 }; 45 53 46 54 # cache.nixos.org is *unbearably* slow when accessed from Mainland China. 47 55 # Fortunately, mirror sites exist... Hooray(?) 48 - nix.settings.substituters = map (url: "${url}/nix-channels/store") (builtins.attrValues cfg.chinese.sites); 56 + nix.settings.substituters = map (url: "${url}/nix-channels/store") ( 57 + builtins.attrValues cfg.chinese.sites 58 + ); 49 59 }; 50 60 }
+7 -3
roles/networking/default.nix
··· 1 - {lib, ...}: let 1 + { lib, ... }: 2 + let 2 3 inherit (lib) mkEnableOption; 3 - in { 4 + in 5 + { 4 6 options.roles.networking = { 5 - enable = mkEnableOption "Networking" // {default = true;}; 7 + enable = mkEnableOption "Networking" // { 8 + default = true; 9 + }; 6 10 }; 7 11 }
+7 -7
roles/networking/nixos.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: let 6 + }: 7 + let 7 8 inherit (lib) mkIf getExe; 8 9 cfg = config.roles.networking; 9 - in { 10 + in 11 + { 10 12 config = mkIf cfg.enable { 11 13 networking.networkmanager.enable = true; 12 - roles.base.user.extraGroups = mkIf config.roles.base.canSudo ["networkmanager"]; 14 + roles.base.user.extraGroups = mkIf config.roles.base.canSudo [ "networkmanager" ]; 13 15 14 - hm.home.packages = [pkgs.networkmanagerapplet]; 15 - roles.hyprland.settings.exec-once = [ 16 - (getExe pkgs.networkmanagerapplet) 17 - ]; 16 + hm.home.packages = [ pkgs.networkmanagerapplet ]; 17 + roles.hyprland.settings.exec-once = [ (getExe pkgs.networkmanagerapplet) ]; 18 18 }; 19 19 }
+17 -16
roles/nix/default.nix
··· 1 + { lib, inputs, ... }: 2 + let 3 + inherit (lib) mkDefault; 4 + in 1 5 { 2 - lib, 3 - inputs, 4 - ... 5 - }: let 6 - inherit (lib) mkDefault; 7 - in { 8 6 nix = { 9 7 registry = { 10 8 nixpkgs.flake = inputs.nixpkgs; 11 9 n.flake = inputs.nixpkgs; 12 10 }; 13 - nixPath = let 14 - toNixPath = input: "${input}=${inputs.${input}.outPath}"; 15 - in [ 16 - (toNixPath "nixpkgs") 17 - ]; 11 + nixPath = 12 + let 13 + toNixPath = input: "${input}=${inputs.${input}.outPath}"; 14 + in 15 + [ (toNixPath "nixpkgs") ]; 18 16 19 17 gc = { 20 18 automatic = mkDefault true; ··· 24 22 25 23 settings = { 26 24 auto-optimise-store = true; 27 - experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"]; 28 - trusted-users = ["@wheel"]; 25 + experimental-features = [ 26 + "nix-command" 27 + "flakes" 28 + "auto-allocate-uids" 29 + "repl-flake" 30 + ]; 31 + trusted-users = [ "@wheel" ]; 29 32 }; 30 33 }; 31 34 nixpkgs = { 32 35 # I'm not part of the FSF and I don't care 33 36 config.allowUnfree = true; 34 37 35 - overlays = [ 36 - (import ../../packages/overlay.nix) 37 - ]; 38 + overlays = [ (import ../../packages/overlay.nix) ]; 38 39 }; 39 40 }
+3 -2
roles/nix/nixos.nix
··· 4 4 lib, 5 5 inputs, 6 6 ... 7 - }: { 7 + }: 8 + { 8 9 system = { 9 10 # Thank @luishfonseca for this 10 11 # https://github.com/luishfonseca/dotfiles/blob/ab7625ec406b48493eda701911ad1cd017ce5bc1/modules/upgrade-diff.nix ··· 19 20 autoUpgrade = { 20 21 enable = true; 21 22 flake = "github:pluiedev/flake#${config.networking.hostName}"; 22 - flags = ["--refresh"]; 23 + flags = [ "--refresh" ]; 23 24 }; 24 25 25 26 configurationRevision = inputs.self.rev or inputs.self.dirtyRev or "unknown-dirty";
+3 -2
roles/nixos.nix
··· 1 - inputs @ {lib, ...}: { 1 + inputs@{ lib, ... }: 2 + { 2 3 imports = 3 - [./.] 4 + [ ./. ] 4 5 ++ (lib.pipe (import ./. inputs).imports [ 5 6 (map (s: /${s}/nixos.nix)) 6 7 (builtins.filter builtins.pathExists)
+4 -2
roles/nvidia/default.nix
··· 1 1 # NVIDIA? More like :novideo: 2 - {lib, ...}: let 2 + { lib, ... }: 3 + let 3 4 inherit (lib) mkEnableOption; 4 - in { 5 + in 6 + { 5 7 options.roles.nvidia.enable = mkEnableOption "NVIDIA drivers"; 6 8 }
+5 -7
roles/nvidia/nixos.nix
··· 1 - { 2 - config, 3 - lib, 4 - ... 5 - }: let 1 + { config, lib, ... }: 2 + let 6 3 cfg = config.roles.plasma; 7 4 inherit (lib) mkIf; 8 - in { 5 + in 6 + { 9 7 config = mkIf cfg.enable { 10 8 hardware = { 11 9 opengl.enable = true; ··· 22 20 }; 23 21 services.xserver = { 24 22 enable = true; 25 - videoDrivers = ["nvidia"]; 23 + videoDrivers = [ "nvidia" ]; 26 24 }; 27 25 }; 28 26 }
+2 -1
roles/plasma/default.nix
··· 1 - {lib, ...}: { 1 + { lib, ... }: 2 + { 2 3 options.roles.plasma = { 3 4 enable = lib.mkEnableOption "Plasma"; 4 5 krunner-nix.enable = lib.mkEnableOption "krunner-nix, a KRunner plugin that suggests Nix programs to run";
+10 -6
roles/plasma/nixos.nix
··· 4 4 pkgs, 5 5 inputs, 6 6 ... 7 - }: let 7 + }: 8 + let 8 9 cfg = config.roles.plasma; 9 10 inherit (lib) mkIf; 10 - in { 11 + in 12 + { 11 13 config = mkIf cfg.enable { 12 14 services = { 13 15 desktopManager.plasma6.enable = true; ··· 20 22 }; 21 23 }; 22 24 23 - xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-kde]; 25 + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ]; 24 26 roles.qt.platform = "kde"; 25 27 26 28 hm = { 27 - imports = [inputs.plasma-manager.homeManagerModules.plasma-manager]; 29 + imports = [ inputs.plasma-manager.homeManagerModules.plasma-manager ]; 28 30 29 - home.packages = lib.optional cfg.krunner-nix.enable inputs.krunner-nix.packages.${pkgs.system}.default; 31 + home.packages = 32 + lib.optional cfg.krunner-nix.enable 33 + inputs.krunner-nix.packages.${pkgs.system}.default; 30 34 31 35 # Janky workaround 32 36 # https://github.com/nix-community/home-manager/issues/1586 33 37 programs.firefox.package = pkgs.firefox.override { 34 - cfg.nativeMessagingHosts.packages = [pkgs.plasma6Packages.plasma-browser-integration]; 38 + cfg.nativeMessagingHosts.packages = [ pkgs.plasma6Packages.plasma-browser-integration ]; 35 39 }; 36 40 37 41 programs.plasma.enable = true;
+24 -5
roles/qt/default.nix
··· 1 - {lib, ...}: let 2 - inherit (lib) mkAliasOptionModule mkEnableOption mkOption types; 3 - in { 1 + { lib, ... }: 2 + let 3 + inherit (lib) 4 + mkAliasOptionModule 5 + mkEnableOption 6 + mkOption 7 + types 8 + ; 9 + in 10 + { 4 11 imports = [ 5 - (mkAliasOptionModule ["roles" "qt" "platform"] ["qt" "platformTheme"]) 12 + (mkAliasOptionModule 13 + [ 14 + "roles" 15 + "qt" 16 + "platform" 17 + ] 18 + [ 19 + "qt" 20 + "platformTheme" 21 + ] 22 + ) 6 23 ]; 7 24 8 25 options.roles.qt = { 9 - enable = mkEnableOption "Qt" // {default = true;}; 26 + enable = mkEnableOption "Qt" // { 27 + default = true; 28 + }; 10 29 11 30 qt5ct.settings = mkOption { 12 31 type = types.nullOr (types.attrsOf types.anything);
+5 -7
roles/qt/nixos.nix
··· 1 - { 2 - config, 3 - lib, 4 - ... 5 - }: let 1 + { config, lib, ... }: 2 + let 6 3 inherit (lib) mkIf; 7 - toINI = lib.generators.toINI {}; 4 + toINI = lib.generators.toINI { }; 8 5 cfg = config.roles.qt; 9 - in { 6 + in 7 + { 10 8 config = mkIf cfg.enable { 11 9 qt.enable = true; 12 10
+27 -15
roles/rust/default.nix
··· 4 4 config, 5 5 inputs, 6 6 ... 7 - }: let 7 + }: 8 + let 8 9 cfg = config.roles.rust; 9 - inherit (lib) mkIf mkOption mkEnableOption types; 10 - in { 10 + inherit (lib) 11 + mkIf 12 + mkOption 13 + mkEnableOption 14 + types 15 + ; 16 + in 17 + { 11 18 options.roles.rust = { 12 19 enable = mkEnableOption "Rust"; 13 20 14 21 rust-bin = mkOption { 15 22 type = types.attrsOf types.anything; 16 23 default = pkgs.rust-bin; 17 - example = pkgs.rust-bin // {distRoot = "some-root";}; 24 + example = pkgs.rust-bin // { 25 + distRoot = "some-root"; 26 + }; 18 27 }; 19 28 20 29 package = mkOption { 21 30 type = types.package; 22 - default = cfg.rust-bin.selectLatestNightlyWith (toolchain: 23 - toolchain.default.override { 24 - extensions = ["rust-analyzer"]; 25 - }); 31 + default = cfg.rust-bin.selectLatestNightlyWith ( 32 + toolchain: toolchain.default.override { extensions = [ "rust-analyzer" ]; } 33 + ); 26 34 example = cfg.rust-bin.stable.latest.default; 27 35 description = "Version of Rust to install. Defaults to latest nightly with rust-analyzer"; 28 36 }; ··· 36 44 37 45 settings = mkOption { 38 46 type = types.nullOr (types.attrsOf types.anything); 39 - default = {}; 47 + default = { }; 40 48 }; 41 49 42 50 rustfmt.settings = mkOption { ··· 50 58 }; 51 59 }; 52 60 53 - config = let 54 - toTOMLFile = pkgs.formats.toml {}; 55 - in 61 + config = 62 + let 63 + toTOMLFile = pkgs.formats.toml { }; 64 + in 56 65 mkIf cfg.enable { 57 - nixpkgs.overlays = [inputs.rust-overlay.overlays.default]; 66 + nixpkgs.overlays = [ inputs.rust-overlay.overlays.default ]; 58 67 59 68 hm = { 60 - home.packages = [cfg.package]; 69 + home.packages = [ cfg.package ]; 61 70 62 71 xdg.configFile."rustfmt/rustfmt.toml" = mkIf (cfg.rustfmt.settings != null) { 63 72 source = toTOMLFile.generate "rustfmt.toml" cfg.rustfmt.settings; ··· 68 77 (lib.optionalAttrs (cfg.linker != null) { 69 78 target.${pkgs.rust.toRustTarget pkgs.hostPlatform} = { 70 79 linker = "${lib.getExe pkgs.clang_16}"; 71 - rustflags = ["-C" "link-arg=-fuse-ld=${cfg.linker}"]; 80 + rustflags = [ 81 + "-C" 82 + "link-arg=-fuse-ld=${cfg.linker}" 83 + ]; 72 84 }; 73 85 }) 74 86 // cfg.settings
+8 -4
roles/xdg/default.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: let 6 + }: 7 + let 7 8 inherit (lib) mkEnableOption mkIf; 8 9 cfg = config.roles.xdg; 9 - in { 10 + in 11 + { 10 12 options.roles.xdg = { 11 - enable = mkEnableOption "XDG" // {default = true;}; 13 + enable = mkEnableOption "XDG" // { 14 + default = true; 15 + }; 12 16 }; 13 17 14 18 config = mkIf cfg.enable { 15 19 hm.xdg.enable = true; 16 - hm.home.packages = [pkgs.xdg-utils]; 20 + hm.home.packages = [ pkgs.xdg-utils ]; 17 21 }; 18 22 }
+17 -17
systems/default.nix
··· 1 + { self, inputs, ... }: 1 2 { 2 - self, 3 - inputs, 4 - ... 5 - }: { 6 - flake = let 7 - inherit (inputs.nixpkgs) lib; 8 - inherit (import ./profiles/lib.nix) mkSystems; 3 + flake = 4 + let 5 + inherit (inputs.nixpkgs) lib; 6 + inherit (import ./profiles/lib.nix) mkSystems; 9 7 10 - profiles = import ./profiles inputs; 11 - machines = import ./machines profiles; 12 - in 8 + profiles = import ./profiles inputs; 9 + machines = import ./machines profiles; 10 + in 13 11 builtins.mapAttrs (_: mkSystems) machines 14 12 // { 15 - hydraJobs = let 16 - ciSystems = ["x86_64-linux"]; 17 - mapCfgsToDerivs = lib.mapAttrs (_: cfg: cfg.activationPackage or cfg.config.system.build.toplevel); 18 - getCompatibleCfgs = lib.filterAttrs (_: cfg: lib.elem cfg.pkgs.system ciSystems); 19 - in { 20 - nixosConfigurations = mapCfgsToDerivs (getCompatibleCfgs self.nixosConfigurations); 21 - }; 13 + hydraJobs = 14 + let 15 + ciSystems = [ "x86_64-linux" ]; 16 + mapCfgsToDerivs = lib.mapAttrs (_: cfg: cfg.activationPackage or cfg.config.system.build.toplevel); 17 + getCompatibleCfgs = lib.filterAttrs (_: cfg: lib.elem cfg.pkgs.system ciSystems); 18 + in 19 + { 20 + nixosConfigurations = mapCfgsToDerivs (getCompatibleCfgs self.nixosConfigurations); 21 + }; 22 22 }; 23 23 }
+1 -4
systems/machines/default.nix
··· 1 + { personal, personal-mac, ... }: 1 2 { 2 - personal, 3 - personal-mac, 4 - ... 5 - }: { 6 3 nixosConfigurations = { 7 4 tagliatelle.profile = personal; 8 5 fettuccine.profile = personal;
+2 -1
systems/machines/fettuccine/default.nix
··· 1 - {inputs, ...}: { 1 + { inputs, ... }: 2 + { 2 3 imports = with inputs.nixos-hardware.nixosModules; [ 3 4 ./hardware-configuration.nix 4 5
+18 -10
systems/machines/fettuccine/hardware-configuration.nix
··· 3 3 lib, 4 4 modulesPath, 5 5 ... 6 - }: { 7 - imports = [ 8 - (modulesPath + "/installer/scan/not-detected.nix") 9 - ]; 6 + }: 7 + { 8 + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; 10 9 11 10 boot = { 12 11 initrd = { 13 - availableKernelModules = ["xhci_pci" "thunderbolt" "vmd" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; 14 - kernelModules = []; 12 + availableKernelModules = [ 13 + "xhci_pci" 14 + "thunderbolt" 15 + "vmd" 16 + "nvme" 17 + "usbhid" 18 + "usb_storage" 19 + "sd_mod" 20 + "sdhci_pci" 21 + ]; 22 + kernelModules = [ ]; 15 23 }; 16 - kernelModules = ["kvm-intel"]; 17 - extraModulePackages = []; 24 + kernelModules = [ "kvm-intel" ]; 25 + extraModulePackages = [ ]; 18 26 }; 19 27 20 28 fileSystems."/" = { ··· 28 36 }; 29 37 30 38 swapDevices = [ 31 - {device = "/dev/disk/by-uuid/d3a01a34-de64-4f58-b29f-ae973cb3e8c2";} 32 - {device = "/swap/swap1";} 39 + { device = "/dev/disk/by-uuid/d3a01a34-de64-4f58-b29f-ae973cb3e8c2"; } 40 + { device = "/swap/swap1"; } 33 41 ]; 34 42 35 43 networking.useDHCP = lib.mkDefault true;
+2 -1
systems/machines/fromage/default.nix
··· 1 - {pkgs, ...}: { 1 + { pkgs, ... }: 2 + { 2 3 services.nix-daemon.enable = true; 3 4 4 5 programs.fish.enable = true;
+2 -1
systems/machines/tagliatelle/default.nix
··· 1 - {inputs, ...}: { 1 + { inputs, ... }: 2 + { 2 3 imports = with inputs.nixos-hardware.nixosModules; [ 3 4 ./hardware-configuration.nix 4 5
+15 -9
systems/machines/tagliatelle/hardware-configuration.nix
··· 3 3 lib, 4 4 modulesPath, 5 5 ... 6 - }: { 7 - imports = [ 8 - (modulesPath + "/installer/scan/not-detected.nix") 9 - ]; 6 + }: 7 + { 8 + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; 10 9 11 10 boot = { 12 11 initrd = { 13 - availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; 14 - kernelModules = []; 12 + availableKernelModules = [ 13 + "nvme" 14 + "xhci_pci" 15 + "ahci" 16 + "usbhid" 17 + "usb_storage" 18 + "sd_mod" 19 + ]; 20 + kernelModules = [ ]; 15 21 }; 16 - kernelModules = ["kvm-amd"]; 17 - extraModulePackages = []; 22 + kernelModules = [ "kvm-amd" ]; 23 + extraModulePackages = [ ]; 18 24 }; 19 25 20 26 fileSystems."/" = { ··· 27 33 fsType = "vfat"; 28 34 }; 29 35 30 - swapDevices = []; 36 + swapDevices = [ ]; 31 37 32 38 networking.useDHCP = lib.mkDefault true; 33 39 hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+14 -13
systems/profiles/lib.nix
··· 1 1 let 2 - mkSystem = name: { 3 - profile, 4 - system ? null, 5 - modules ? [], 6 - specialArgs ? {}, 7 - }: let 8 - profile' = profile name; 9 - system' = 10 - if (system != null) 11 - then system 12 - else profile'.system; 13 - in 2 + mkSystem = 3 + name: 4 + { 5 + profile, 6 + system ? null, 7 + modules ? [ ], 8 + specialArgs ? { }, 9 + }: 10 + let 11 + profile' = profile name; 12 + system' = if (system != null) then system else profile'.system; 13 + in 14 14 profile'.builder { 15 15 system = system'; 16 16 specialArgs = profile'.specialArgs // specialArgs; ··· 25 25 } 26 26 ]; 27 27 }; 28 - in { 28 + in 29 + { 29 30 inherit mkSystem; 30 31 mkSystems = builtins.mapAttrs mkSystem; 31 32 }
+6 -7
systems/profiles/personal-mac/default.nix
··· 1 - inputs @ { 2 - nix-darwin, 3 - home-manager, 4 - ... 5 - }: name: { 1 + inputs@{ nix-darwin, home-manager, ... }: 2 + name: { 6 3 system = "x86_64-darwin"; 7 4 builder = nix-darwin.lib.darwinSystem; 8 5 ··· 12 9 ../../../roles/darwin.nix 13 10 ../../../users/personal.nix 14 11 15 - {system.stateVersion = 4;} 12 + { system.stateVersion = 4; } 16 13 ]; 17 - specialArgs = {inherit inputs;}; 14 + specialArgs = { 15 + inherit inputs; 16 + }; 18 17 }
+6 -7
systems/profiles/personal/default.nix
··· 1 - inputs @ { 2 - nixpkgs, 3 - home-manager, 4 - ... 5 - }: name: { 1 + inputs@{ nixpkgs, home-manager, ... }: 2 + name: { 6 3 system = "x86_64-linux"; 7 4 builder = nixpkgs.lib.nixosSystem; 8 5 ··· 12 9 ../../../roles/nixos.nix 13 10 ../../../users/personal.nix 14 11 15 - {system.stateVersion = "24.05";} 12 + { system.stateVersion = "24.05"; } 16 13 ]; 17 - specialArgs = {inherit inputs;}; 14 + specialArgs = { 15 + inherit inputs; 16 + }; 18 17 }
+1 -3
users/leah/containers/default.nix
··· 1 - { 2 - imports = [./postgres.nix]; 3 - } 1 + { imports = [ ./postgres.nix ]; }
+19 -17
users/leah/containers/postgres.nix
··· 1 1 { 2 2 containers.postgres = { 3 3 autoStart = true; 4 - config = { 5 - config, 6 - pkgs, 7 - lib, 8 - ... 9 - }: { 10 - services.postgresql = { 11 - enable = true; 12 - package = pkgs.postgresql_16; 13 - ensureDatabases = ["postgres"]; 14 - authentication = '' 15 - # TYPE DATABASE USER ADDRESS METHOD 16 - host all all localhost trust 17 - ''; 18 - }; 4 + config = 5 + { 6 + config, 7 + pkgs, 8 + lib, 9 + ... 10 + }: 11 + { 12 + services.postgresql = { 13 + enable = true; 14 + package = pkgs.postgresql_16; 15 + ensureDatabases = [ "postgres" ]; 16 + authentication = '' 17 + # TYPE DATABASE USER ADDRESS METHOD 18 + host all all localhost trust 19 + ''; 20 + }; 19 21 20 - system.stateVersion = "24.05"; 21 - }; 22 + system.stateVersion = "24.05"; 23 + }; 22 24 }; 23 25 }
+45 -29
users/leah/default.nix
··· 3 3 pkgs, 4 4 inputs, 5 5 ... 6 - }: { 6 + }: 7 + { 7 8 imports = [ 8 9 ./containers 9 10 ./presets/plasma ··· 28 29 accent = "maroon"; 29 30 }; 30 31 31 - roles.email = let 32 - realName = config.roles.base.fullName; 33 - host = { 34 - imap = { 35 - host = "imap.migadu.com"; 36 - port = 993; 37 - }; 38 - smtp = { 39 - host = "smtp.migadu.com"; 40 - port = 465; 41 - }; 42 - }; 43 - in { 44 - enable = true; 45 - accounts = { 46 - "hi@pluie.me" = { 47 - inherit realName host; 48 - primary = true; 32 + roles.email = 33 + let 34 + realName = config.roles.base.fullName; 35 + host = { 36 + imap = { 37 + host = "imap.migadu.com"; 38 + port = 993; 39 + }; 40 + smtp = { 41 + host = "smtp.migadu.com"; 42 + port = 465; 43 + }; 49 44 }; 50 - "acc@pluie.me" = { 51 - inherit host; 52 - realName = "${realName} [accounts]"; 45 + in 46 + { 47 + enable = true; 48 + accounts = { 49 + "hi@pluie.me" = { 50 + inherit realName host; 51 + primary = true; 52 + }; 53 + "acc@pluie.me" = { 54 + inherit host; 55 + realName = "${realName} [accounts]"; 56 + }; 53 57 }; 54 58 }; 55 - }; 56 59 57 60 roles.fonts = { 58 61 enable = true; 59 62 packages = with pkgs; [ 60 - (nerdfonts.override {fonts = ["Iosevka"];}) 63 + (nerdfonts.override { fonts = [ "Iosevka" ]; }) 61 64 noto-fonts 62 65 noto-fonts-extra 63 66 noto-fonts-emoji ··· 69 72 ]; 70 73 71 74 defaults = { 72 - serif = ["Libertinus Serif" "LXGW WenKai"]; 73 - sansSerif = ["Rethink Sans" "LXGW Neo XiHei"]; 74 - emoji = ["Noto Color Emoji"]; 75 - monospace = ["Iosevka Nerd Font" "LXGW Neo XiHei"]; 75 + serif = [ 76 + "Libertinus Serif" 77 + "LXGW WenKai" 78 + ]; 79 + sansSerif = [ 80 + "Rethink Sans" 81 + "LXGW Neo XiHei" 82 + ]; 83 + emoji = [ "Noto Color Emoji" ]; 84 + monospace = [ 85 + "Iosevka Nerd Font" 86 + "LXGW Neo XiHei" 87 + ]; 76 88 }; 77 89 }; 78 90 ··· 88 100 89 101 networking.firewall = { 90 102 enable = true; 91 - allowedTCPPorts = [80 443 5173]; 103 + allowedTCPPorts = [ 104 + 80 105 + 443 106 + 5173 107 + ]; 92 108 }; 93 109 94 110 nix.package = pkgs.nixVersions.nix_2_21;
+10 -11
users/leah/presets/hyprland/clipboard.nix
··· 1 + { pkgs, lib, ... }: 1 2 { 2 - pkgs, 3 - lib, 4 - ... 5 - }: { 6 3 hm.services.cliphist.enable = true; 7 4 8 5 hm.wayland.windowManager.hyprland.settings = { 9 - exec-once = let 10 - wl-paste = lib.getExe' pkgs.wl-clipboard "wl-paste"; 11 - cliphist = lib.getExe pkgs.cliphist; 12 - in [ 13 - "${wl-paste} --type text --watch ${cliphist} store" 14 - "${wl-paste} --type image --watch ${cliphist} store" 15 - ]; 6 + exec-once = 7 + let 8 + wl-paste = lib.getExe' pkgs.wl-clipboard "wl-paste"; 9 + cliphist = lib.getExe pkgs.cliphist; 10 + in 11 + [ 12 + "${wl-paste} --type text --watch ${cliphist} store" 13 + "${wl-paste} --type image --watch ${cliphist} store" 14 + ]; 16 15 }; 17 16 }
+2 -1
users/leah/presets/hyprland/default.nix
··· 1 - {pkgs, ...}: { 1 + { pkgs, ... }: 2 + { 2 3 imports = [ 3 4 ./waybar 4 5
+3 -6
users/leah/presets/hyprland/dolphin.nix
··· 1 + { pkgs, lib, ... }: 1 2 { 2 - pkgs, 3 - lib, 4 - ... 5 - }: { 6 - hm.home.packages = [pkgs.dolphin]; 3 + hm.home.packages = [ pkgs.dolphin ]; 7 4 8 5 # TODO: annoy maintainers to add meta.mainProgram 9 - roles.hyprland.settings.bind = ["$mod, E, exec, ${lib.getExe' pkgs.dolphin "dolphin"}"]; 6 + roles.hyprland.settings.bind = [ "$mod, E, exec, ${lib.getExe' pkgs.dolphin "dolphin"}" ]; 10 7 11 8 # Required for detecting storage devices 12 9 services.udisks2.enable = true;
+1 -4
users/leah/presets/hyprland/greetd.nix
··· 1 + { lib, pkgs, ... }: 1 2 { 2 - lib, 3 - pkgs, 4 - ... 5 - }: { 6 3 services.greetd = { 7 4 enable = true; 8 5 settings.default_session = {
+2 -1
users/leah/presets/hyprland/media.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: { 6 + }: 7 + { 7 8 hm.services = { 8 9 mpris-proxy.enable = true; 9 10 mpd = {
+10 -8
users/leah/presets/hyprland/qt.nix
··· 1 - { 2 - lib, 3 - pkgs, 4 - ... 5 - }: let 1 + { lib, pkgs, ... }: 2 + let 6 3 settings = { 7 4 Appearance = { 8 5 icon_theme = "breeze-dark"; ··· 35 32 ignored_applications = "@Invalid()"; 36 33 }; 37 34 }; 38 - in { 35 + in 36 + { 39 37 hm.home.packages = with pkgs; [ 40 38 breeze-icons 41 39 ··· 46 44 roles.qt = { 47 45 platform = "qt5ct"; 48 46 49 - qt5ct = {inherit settings;}; 50 - qt6ct = {inherit settings;}; 47 + qt5ct = { 48 + inherit settings; 49 + }; 50 + qt6ct = { 51 + inherit settings; 52 + }; 51 53 }; 52 54 }
+2 -1
users/leah/presets/hyprland/screenshots.nix
··· 3 3 pkgs, 4 4 lib, 5 5 ... 6 - }: { 6 + }: 7 + { 7 8 hm.home.packages = with pkgs; [ 8 9 hyprpicker 9 10 grimblast
+24 -17
users/leah/presets/hyprland/settings.nix
··· 1 + { lib, pkgs, ... }: 1 2 { 2 - lib, 3 - pkgs, 4 - ... 5 - }: { 6 - hm.wayland.windowManager.hyprland.settings = let 7 - inherit (lib) getExe flatten mod range pipe; 8 - in 9 - with pkgs; { 3 + hm.wayland.windowManager.hyprland.settings = 4 + let 5 + inherit (lib) 6 + getExe 7 + flatten 8 + mod 9 + range 10 + pipe 11 + ; 12 + in 13 + with pkgs; 14 + { 10 15 "$mod" = "SUPER"; 11 16 12 17 monitor = "eDP-1,2560x1600@165,0x0,1.25"; ··· 124 129 # Switch workspaces with mod + [0-9] 125 130 # Move active window to a workspace with mod + SHIFT + [0-9] 126 131 pipe (range 1 10) [ 127 - (map (i: let 128 - key = mod i 10; 129 - in [ 130 - "$mod, ${toString key}, workspace, ${toString i}" 131 - "$mod SHIFT, ${toString key}, movetoworkspace, ${toString i}" 132 - ])) 132 + (map ( 133 + i: 134 + let 135 + key = mod i 10; 136 + in 137 + [ 138 + "$mod, ${toString key}, workspace, ${toString i}" 139 + "$mod SHIFT, ${toString key}, movetoworkspace, ${toString i}" 140 + ] 141 + )) 133 142 flatten 134 143 ]; 135 144 136 145 # Press Super once to open Fuzzel; twice to close it 137 - bindr = [ 138 - "$mod, Super_L, exec, pkill fuzzel || ${getExe fuzzel}" 139 - ]; 146 + bindr = [ "$mod, Super_L, exec, pkill fuzzel || ${getExe fuzzel}" ]; 140 147 141 148 bindm = [ 142 149 # Move/resize windows with mod + LMB/RMB and dragging
+62 -16
users/leah/presets/hyprland/waybar/default.nix
··· 3 3 pkgs, 4 4 lib, 5 5 ... 6 - }: let 6 + }: 7 + let 7 8 # Kill and restart waybar if running 8 9 onChange = "(ps aux | grep waybar | grep -v grep) && (${lib.getExe' pkgs.procps "pkill"} -u $USER waybar) && (${lib.getExe pkgs.waybar})"; 9 - in { 10 - hm.home.packages = with pkgs; [font-awesome]; 10 + in 11 + { 12 + hm.home.packages = with pkgs; [ font-awesome ]; 11 13 12 14 hm.xdg.configFile = { 13 - "waybar/config" = {inherit onChange;}; 14 - "waybar/style.css" = {inherit onChange;}; 15 + "waybar/config" = { 16 + inherit onChange; 17 + }; 18 + "waybar/style.css" = { 19 + inherit onChange; 20 + }; 15 21 }; 16 22 17 23 hm.programs.waybar = { ··· 24 30 layer = "top"; 25 31 position = "bottom"; 26 32 27 - modules-left = ["tray"]; 28 - modules-center = ["wlr/taskbar"]; 29 - modules-right = ["pulseaudio" "backlight" "battery" "bluetooth" "network"]; 33 + modules-left = [ "tray" ]; 34 + modules-center = [ "wlr/taskbar" ]; 35 + modules-right = [ 36 + "pulseaudio" 37 + "backlight" 38 + "battery" 39 + "bluetooth" 40 + "network" 41 + ]; 30 42 31 43 tray = { 32 44 icon-size = 20; ··· 37 49 icon-size = 20; 38 50 tooltip-format = "{title}"; 39 51 on-click = "activate"; 40 - ignore-list = ["kitty"]; 52 + ignore-list = [ "kitty" ]; 41 53 }; 42 54 pulseaudio = { 43 55 format = "{icon} {volume}% {format_source}"; ··· 53 65 phone = ""; 54 66 portable = ""; 55 67 car = ""; 56 - default = ["󰕿" "" "󰕾"]; 68 + default = [ 69 + "󰕿" 70 + "" 71 + "󰕾" 72 + ]; 57 73 }; 58 74 }; 59 75 backlight = { 60 76 device = "intel_backlight"; 61 77 format = "{icon} {percent}%"; 62 - format-icons = ["󱩎" "󱩏" "󱩐" "󱩑" "󱩒" "󱩓" "󱩔" "󱩕" "󱩖" "󰛨"]; 78 + format-icons = [ 79 + "󱩎" 80 + "󱩏" 81 + "󱩐" 82 + "󱩑" 83 + "󱩒" 84 + "󱩓" 85 + "󱩔" 86 + "󱩕" 87 + "󱩖" 88 + "󰛨" 89 + ]; 63 90 }; 64 91 battery = { 65 92 interval = 1; ··· 73 100 format = "{icon} {capacity}%"; 74 101 format-charging = "󰂄 {capacity}%"; 75 102 format-critical = "󰂃 {capacity}%"; 76 - format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; 103 + format-icons = [ 104 + "󰁺" 105 + "󰁻" 106 + "󰁼" 107 + "󰁽" 108 + "󰁾" 109 + "󰁿" 110 + "󰂀" 111 + "󰂁" 112 + "󰂂" 113 + "󰁹" 114 + ]; 77 115 }; 78 116 bluetooth = { 79 117 format = ""; ··· 96 134 layer = "top"; 97 135 position = "top"; 98 136 99 - modules-left = ["hyprland/workspaces"]; 100 - modules-center = ["clock"]; 101 - modules-right = ["cpu" "custom/gpu" "memory" "custom/wlogout"]; 137 + modules-left = [ "hyprland/workspaces" ]; 138 + modules-center = [ "clock" ]; 139 + modules-right = [ 140 + "cpu" 141 + "custom/gpu" 142 + "memory" 143 + "custom/wlogout" 144 + ]; 102 145 103 146 clock = { 104 147 interval = 1; 105 - timezones = ["Europe/Berlin" "Asia/Shanghai"]; 148 + timezones = [ 149 + "Europe/Berlin" 150 + "Asia/Shanghai" 151 + ]; 106 152 format = "{:<span color='#7f849c'><span color='#f38ba8'>%R</span> | <span color='#fab387'>%a</span> <span color='#f9e2af'>%d</span>.<span color='#a6e3a1'>%m</span>.<span color='#89dceb'>%y</span> | <span color='#b4befe'>%z</span></span>}"; 107 153 tooltip-format = "<tt><span color='#7f849c'>{:<span color='#f38ba8'>%T</span> | <span color='#fab387'>%A</span>, <span color='#f9e2af'>%e</span> <span color='#a6e3a1'>%b</span> <span color='#89dceb'>%Y</span> | <span color='#b4befe'>UTC%Ez (%Z)</span>}</span></tt>\n\n<tt><small>{calendar}</small></tt>"; 108 154
+6 -5
users/leah/presets/plasma/default.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: let 6 + }: 7 + let 7 8 inherit (config.hm) gtk; 8 9 9 - optionalPackage = opt: 10 - lib.optional (opt != null && opt.package != null) opt.package; 11 - in { 10 + optionalPackage = opt: lib.optional (opt != null && opt.package != null) opt.package; 11 + in 12 + { 12 13 imports = [ 13 14 ./sddm.nix 14 15 ./settings ··· 23 24 # KDE manages GTK stuff by itself 24 25 #hm.gtk.enable = lib.mkForce false; 25 26 26 - hm.home.packages = with pkgs; [wl-clipboard]; 27 + hm.home.packages = with pkgs; [ wl-clipboard ]; 27 28 #++ lib.concatMap optionalPackage [ 28 29 # gtk.theme 29 30 # gtk.cursorTheme
+28 -21
users/leah/presets/plasma/settings/default.nix
··· 1 + { lib, config, ... }: 1 2 { 2 - lib, 3 - config, 4 - ... 5 - }: { 6 - imports = [./panels.nix]; 3 + imports = [ ./panels.nix ]; 7 4 8 5 hm.programs.plasma = { 9 6 enable = true; 10 7 11 - fonts = let 12 - rethink = { 13 - family = "Rethink Sans"; 14 - pointSize = 10; 15 - }; 16 - in { 17 - general = rethink // {pointSize = 11;}; 18 - fixedWidth = { 19 - family = "Iosevka Nerd Font"; 20 - pointSize = 11; 8 + fonts = 9 + let 10 + rethink = { 11 + family = "Rethink Sans"; 12 + pointSize = 10; 13 + }; 14 + in 15 + { 16 + general = rethink // { 17 + pointSize = 11; 18 + }; 19 + fixedWidth = { 20 + family = "Iosevka Nerd Font"; 21 + pointSize = 11; 22 + }; 23 + small = rethink // { 24 + pointSize = 8; 25 + }; 26 + toolbar = rethink; 27 + menu = rethink; 28 + windowTitle = rethink; 21 29 }; 22 - small = rethink // {pointSize = 8;}; 23 - toolbar = rethink; 24 - menu = rethink; 25 - windowTitle = rethink; 26 - }; 27 30 28 31 workspace = { 29 32 clickItemTo = "select"; ··· 40 43 virtualDesktops = { 41 44 animation = "slide"; 42 45 rows = 1; 43 - names = ["Default" "Flake" "Webdev"]; 46 + names = [ 47 + "Default" 48 + "Flake" 49 + "Webdev" 50 + ]; 44 51 }; 45 52 }; 46 53
+44 -19
users/leah/presets/plasma/settings/panels.nix
··· 1 1 { 2 - hm.programs.plasma.panels = let 3 - base = { 4 - hiding = "dodgewindows"; 5 - floating = true; 6 - height = 36; 7 - location = "top"; 8 - lengthMode = "fit"; 9 - }; 10 - in 2 + hm.programs.plasma.panels = 3 + let 4 + base = { 5 + hiding = "dodgewindows"; 6 + floating = true; 7 + height = 36; 8 + location = "top"; 9 + lengthMode = "fit"; 10 + }; 11 + in 11 12 map (p: base // p) [ 12 13 { 13 14 height = 60; ··· 18 19 name = "org.kde.plasma.kickoff"; # Application Launcher 19 20 config.General = { 20 21 primaryActions = "2"; # Custom buttons 21 - systemFavorites = ["lock-screen" "logout" "suspend" "reboot" "shutdown"]; 22 + systemFavorites = [ 23 + "lock-screen" 24 + "logout" 25 + "suspend" 26 + "reboot" 27 + "shutdown" 28 + ]; 22 29 showActionButtonCaptions = "false"; 23 30 }; 24 31 } ··· 38 45 color = "250,179,135"; # Peach 39 46 } 40 47 ]; 41 - totalSensors = ["cpu/all/usage"]; 42 - textOnlySensors = ["cpu/all/averageTemperature" "cpu/all/averageFrequency"]; 48 + totalSensors = [ "cpu/all/usage" ]; 49 + textOnlySensors = [ 50 + "cpu/all/averageTemperature" 51 + "cpu/all/averageFrequency" 52 + ]; 43 53 }; 44 54 } 45 55 { ··· 51 61 color = "180,190,254"; # Lavender 52 62 } 53 63 ]; 54 - totalSensors = ["gpu/gpu1/usage"]; 55 - textOnlySensors = ["gpu/gpu1/temperature" "gpu/gpu1/frequency" "gpu/gpu1/power" "gpu/gpu1/usedVram" "gpu/gpu1/totalVram"]; 64 + totalSensors = [ "gpu/gpu1/usage" ]; 65 + textOnlySensors = [ 66 + "gpu/gpu1/temperature" 67 + "gpu/gpu1/frequency" 68 + "gpu/gpu1/power" 69 + "gpu/gpu1/usedVram" 70 + "gpu/gpu1/totalVram" 71 + ]; 56 72 }; 57 73 } 58 74 { ··· 64 80 color = "166,227,161"; # Green 65 81 } 66 82 ]; 67 - totalSensors = ["memory/physical/usedPercent"]; 68 - textOnlySensors = ["memory/physical/used" "memory/physical/total"]; 83 + totalSensors = [ "memory/physical/usedPercent" ]; 84 + textOnlySensors = [ 85 + "memory/physical/used" 86 + "memory/physical/total" 87 + ]; 69 88 }; 70 89 } 71 90 ]; ··· 78 97 date.format.custom = "d MMM ''yy / ddd"; 79 98 time.format = "24h"; 80 99 timeZone = { 81 - selected = ["Europe/Berlin" "Asia/Shanghai"]; 100 + selected = [ 101 + "Europe/Berlin" 102 + "Asia/Shanghai" 103 + ]; 82 104 changeOnScroll = true; 83 105 format = "city"; 84 106 }; ··· 93 115 systemTray = { 94 116 icons.scaleToFit = true; 95 117 items = { 96 - shown = ["org.kde.plasma.battery"]; 97 - hidden = ["org.kde.plasma.brightness" "org.kde.plasma.clipboard"]; 118 + shown = [ "org.kde.plasma.battery" ]; 119 + hidden = [ 120 + "org.kde.plasma.brightness" 121 + "org.kde.plasma.clipboard" 122 + ]; 98 123 configs.battery.showPercentage = true; 99 124 }; 100 125 };
+2 -1
users/leah/programs/1password/default.nix
··· 3 3 lib, 4 4 config, 5 5 ... 6 - }: { 6 + }: 7 + { 7 8 programs = { 8 9 _1password.enable = true; 9 10 _1password-gui = {
+7 -5
users/leah/programs/default.nix
··· 4 4 lib, 5 5 inputs, 6 6 ... 7 - }: { 7 + }: 8 + { 8 9 imports = [ 9 10 ./1password 10 11 ./discord ··· 34 35 programs = { 35 36 steam = { 36 37 enable = true; 37 - extraCompatPackages = [pkgs.proton-ge-bin]; 38 + extraCompatPackages = [ pkgs.proton-ge-bin ]; 38 39 remotePlay.openFirewall = true; 39 40 }; 40 41 nix-ld = { ··· 47 48 bat = { 48 49 enable = true; 49 50 config = { 50 - map-syntax = ["flake.lock:JSON"]; 51 + map-syntax = [ "flake.lock:JSON" ]; 51 52 }; 52 53 syntaxes = { 53 54 just = { 54 55 src = lib.cleanSourceWith { 55 - filter = name: type: 56 + filter = 57 + name: type: 56 58 lib.cleanSourceFilter name type 57 59 && !builtins.elem (baseNameOf name) [ 58 60 "ShellScript (for Just).sublime-syntax" ··· 104 106 settings = { 105 107 preset = "lesbian"; 106 108 mode = "rgb"; 107 - lightness = 0.60; 109 + lightness = 0.6; 108 110 color_align.mode = "horizontal"; 109 111 backend = "fastfetch"; 110 112 };
+25 -22
users/leah/programs/fcitx5/default.nix
··· 1 - {pkgs, ...}: { 1 + { pkgs, ... }: 2 + { 2 3 hm.i18n.inputMethod = { 3 4 enabled = "fcitx5"; 4 5 fcitx5 = { 5 - addons = [pkgs.fcitx5-mozc]; 6 + addons = [ pkgs.fcitx5-mozc ]; 6 7 7 8 catppuccin.enable = false; # TODO 8 9 ··· 18 19 rime = { 19 20 enable = true; 20 21 21 - settings = let 22 - luna_pinyin.patch."speller/algebra" = [ 23 - "erase/^xx$/" 24 - "derive/in$/ing/" # in/ing 不分 25 - "derive/ing$/in/" 22 + settings = 23 + let 24 + luna_pinyin.patch."speller/algebra" = [ 25 + "erase/^xx$/" 26 + "derive/in$/ing/" # in/ing 不分 27 + "derive/ing$/in/" 26 28 27 - # 非标拼写 28 - "derive/^([nl])ve$/$1ue/" # nve = nue, lve = lue 29 - "derive/^([jqxy])v/$1u/" # ju = jv 30 - "derive/uen$/un/" # gun = guen 31 - "derive/uei$/ui/" # gui = guei 32 - "derive/iou$/iu/" # jiu = jiou 33 - ]; 34 - in { 35 - default.patch.schema_list = [ 36 - {schema = "luna_pinyin_simp";} 37 - {schema = "luna_pinyin";} 38 - ]; 39 - inherit luna_pinyin; 40 - luna_pinyin_simp = luna_pinyin; 41 - }; 29 + # 非标拼写 30 + "derive/^([nl])ve$/$1ue/" # nve = nue, lve = lue 31 + "derive/^([jqxy])v/$1u/" # ju = jv 32 + "derive/uen$/un/" # gun = guen 33 + "derive/uei$/ui/" # gui = guei 34 + "derive/iou$/iu/" # jiu = jiou 35 + ]; 36 + in 37 + { 38 + default.patch.schema_list = [ 39 + { schema = "luna_pinyin_simp"; } 40 + { schema = "luna_pinyin"; } 41 + ]; 42 + inherit luna_pinyin; 43 + luna_pinyin_simp = luna_pinyin; 44 + }; 42 45 }; 43 46 }; 44 47 };
+117 -113
users/leah/programs/firefox/default.nix
··· 4 4 pkgs, 5 5 inputs, 6 6 ... 7 - }: { 7 + }: 8 + { 8 9 hm.programs.firefox = { 9 10 enable = true; 10 11 ··· 12 13 isDefault = true; 13 14 name = config.roles.base.realName; 14 15 15 - extensions = let 16 - # FIXME: firefox-addons currently receives free-only nixpkgs, 17 - # and so unfree plugins are blocked from evaluation. 18 - # Use this one dirty trick to make the FSF mad! :trolley: 19 - gaslight = pkgs: 20 - pkgs.overrideAttrs { 21 - meta.license.free = true; 22 - }; 23 - in 16 + extensions = 17 + let 18 + # FIXME: firefox-addons currently receives free-only nixpkgs, 19 + # and so unfree plugins are blocked from evaluation. 20 + # Use this one dirty trick to make the FSF mad! :trolley: 21 + gaslight = pkgs: pkgs.overrideAttrs { meta.license.free = true; }; 22 + in 24 23 with inputs.firefox-addons.packages.${pkgs.system}; 25 - map gaslight [ 26 - # Essentials 27 - auto-tab-discard 28 - onepassword-password-manager 29 - ublock-origin 24 + map gaslight [ 25 + # Essentials 26 + auto-tab-discard 27 + onepassword-password-manager 28 + ublock-origin 30 29 31 - # Avoid annoyances 32 - consent-o-matic 33 - don-t-fuck-with-paste 34 - enhanced-h264ify 35 - fastforwardteam 36 - faststream 37 - gaoptout 38 - istilldontcareaboutcookies 39 - link-cleaner 40 - musescore-downloader 41 - native-mathml 42 - privacy-possum 43 - re-enable-right-click 44 - sponsorblock 45 - terms-of-service-didnt-read 46 - youtube-nonstop 30 + # Avoid annoyances 31 + consent-o-matic 32 + don-t-fuck-with-paste 33 + enhanced-h264ify 34 + fastforwardteam 35 + faststream 36 + gaoptout 37 + istilldontcareaboutcookies 38 + link-cleaner 39 + musescore-downloader 40 + native-mathml 41 + privacy-possum 42 + re-enable-right-click 43 + sponsorblock 44 + terms-of-service-didnt-read 45 + youtube-nonstop 47 46 48 - # Redirectors 49 - indie-wiki-buddy 50 - libredirect 51 - localcdn 52 - modrinthify 47 + # Redirectors 48 + indie-wiki-buddy 49 + libredirect 50 + localcdn 51 + modrinthify 53 52 54 - # Augmentations 55 - augmented-steam 56 - github-file-icons 57 - octolinker 58 - protondb-for-steam 59 - refined-github 60 - widegithub 61 - wikiwand-wikipedia-modernized 53 + # Augmentations 54 + augmented-steam 55 + github-file-icons 56 + octolinker 57 + protondb-for-steam 58 + refined-github 59 + widegithub 60 + wikiwand-wikipedia-modernized 62 61 63 - # Language 64 - furiganaize 65 - immersive-translate 66 - languagetool 67 - 68 - # Styling 69 - darkreader 70 - firefox-color 71 - stylus 62 + # Language 63 + furiganaize 64 + immersive-translate 65 + languagetool 72 66 73 - # Dev 74 - a11ycss 75 - header-editor 76 - rust-search-extension 67 + # Styling 68 + darkreader 69 + firefox-color 70 + stylus 77 71 78 - disconnect 79 - pronoundb 80 - search-by-image 81 - unpaywall 82 - wayback-machine 83 - ]; 72 + # Dev 73 + a11ycss 74 + header-editor 75 + rust-search-extension 84 76 85 - search = let 86 - mkParams = lib.mapAttrsToList lib.nameValuePair; 87 - nixIcon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; 88 - nixosSearch = path: aliases: { 89 - urls = [{template = "https://nixpkgs.dev${path}/{searchTerms}";}]; 90 - icon = nixIcon; 91 - definedAliases = aliases; 92 - }; 77 + disconnect 78 + pronoundb 79 + search-by-image 80 + unpaywall 81 + wayback-machine 82 + ]; 93 83 94 - search = path: queryKey: { 95 - template = path; 96 - params = mkParams {${queryKey} = "{searchTerms}";}; 97 - }; 98 - in { 99 - default = "DuckDuckGo"; 100 - force = true; 101 - engines = { 102 - "Nixpkgs" = nixosSearch "" ["@np"]; 103 - "NixOS Options" = nixosSearch "/option" ["@ns" "@no"]; 104 - "NixOS Wiki" = { 105 - urls = [(search "https://nixos.wiki/index.php" "search")]; 84 + search = 85 + let 86 + mkParams = lib.mapAttrsToList lib.nameValuePair; 87 + nixIcon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; 88 + nixosSearch = path: aliases: { 89 + urls = [ { template = "https://nixpkgs.dev${path}/{searchTerms}"; } ]; 106 90 icon = nixIcon; 107 - definedAliases = ["@nw"]; 91 + definedAliases = aliases; 108 92 }; 109 - "Nixpkgs PR Tracker" = { 110 - urls = [(search "https://nixpk.gs/pr-tracker.html" "pr")]; 111 - icon = nixIcon; 112 - definedAliases = ["@npr"]; 93 + 94 + search = path: queryKey: { 95 + template = path; 96 + params = mkParams { ${queryKey} = "{searchTerms}"; }; 113 97 }; 114 - "Home Manager Settings" = { 115 - urls = [(search "https://home-manager-options.extranix.com" "query")]; 116 - icon = nixIcon; 117 - definedAliases = ["@hm"]; 118 - }; 119 - "Wiktionary" = { 120 - urls = [(search "https://en.wiktionary.org/wiki/Special:Search" "search")]; 121 - icon = "https://en.wiktionary.org/favicon.ico"; 122 - definedAliases = ["@wkt"]; 123 - }; 124 - "GitHub" = { 125 - urls = [(search "https://github.com/search" "q")]; 126 - icon = "https://github.com/favicon.ico"; 127 - definedAliases = ["@gh"]; 128 - }; 129 - "docs.rs" = { 130 - urls = [(search "https://docs.rs/releases/search" "query")]; 131 - icon = "https://docs.rs/-/static/favicon.ico"; 132 - definedAliases = ["@rs"]; 133 - }; 134 - "lib.rs" = { 135 - urls = [(search "https://lib.rs/search" "q")]; 136 - icon = "https://lib.rs/favicon.ico"; 137 - definedAliases = ["@lrs"]; 98 + in 99 + { 100 + default = "DuckDuckGo"; 101 + force = true; 102 + engines = { 103 + "Nixpkgs" = nixosSearch "" [ "@np" ]; 104 + "NixOS Options" = nixosSearch "/option" [ 105 + "@ns" 106 + "@no" 107 + ]; 108 + "NixOS Wiki" = { 109 + urls = [ (search "https://nixos.wiki/index.php" "search") ]; 110 + icon = nixIcon; 111 + definedAliases = [ "@nw" ]; 112 + }; 113 + "Nixpkgs PR Tracker" = { 114 + urls = [ (search "https://nixpk.gs/pr-tracker.html" "pr") ]; 115 + icon = nixIcon; 116 + definedAliases = [ "@npr" ]; 117 + }; 118 + "Home Manager Settings" = { 119 + urls = [ (search "https://home-manager-options.extranix.com" "query") ]; 120 + icon = nixIcon; 121 + definedAliases = [ "@hm" ]; 122 + }; 123 + "Wiktionary" = { 124 + urls = [ (search "https://en.wiktionary.org/wiki/Special:Search" "search") ]; 125 + icon = "https://en.wiktionary.org/favicon.ico"; 126 + definedAliases = [ "@wkt" ]; 127 + }; 128 + "GitHub" = { 129 + urls = [ (search "https://github.com/search" "q") ]; 130 + icon = "https://github.com/favicon.ico"; 131 + definedAliases = [ "@gh" ]; 132 + }; 133 + "docs.rs" = { 134 + urls = [ (search "https://docs.rs/releases/search" "query") ]; 135 + icon = "https://docs.rs/-/static/favicon.ico"; 136 + definedAliases = [ "@rs" ]; 137 + }; 138 + "lib.rs" = { 139 + urls = [ (search "https://lib.rs/search" "q") ]; 140 + icon = "https://lib.rs/favicon.ico"; 141 + definedAliases = [ "@lrs" ]; 142 + }; 138 143 }; 139 144 }; 140 - }; 141 145 }; 142 146 }; 143 147 }
+2 -1
users/leah/programs/nvim/default.nix
··· 1 - {pkgs, ...}: { 1 + { pkgs, ... }: 2 + { 2 3 imports = [ 3 4 ./lsp.nix 4 5 ./plugins.nix
+2 -1
users/leah/programs/nvim/lsp.nix
··· 1 - {pkgs, ...}: { 1 + { pkgs, ... }: 2 + { 2 3 hm.home.packages = with pkgs; [ 3 4 # Language servers 4 5 lua-language-server
+14 -10
users/leah/programs/nvim/plugins.nix
··· 1 - {pkgs, ...}: let 1 + { pkgs, ... }: 2 + let 2 3 # TODO: upstream 3 4 format-on-save = pkgs.vimUtils.buildVimPlugin { 4 5 pname = "format-on-save.nvim"; ··· 12 13 meta.homepage = "https://github.com/elentok/format-on-save.nvim"; 13 14 }; 14 15 15 - luaConf = plugin: filename: 16 - if !builtins.isPath ./lua/plugins/${filename}.lua 17 - then throw "Config for ${filename} not found at ./lua/plugins/${filename}.lua" 18 - else { 19 - inherit plugin; 20 - type = "lua"; 21 - config = "require 'plugins.${filename}'"; 22 - }; 23 - in { 16 + luaConf = 17 + plugin: filename: 18 + if !builtins.isPath ./lua/plugins/${filename}.lua then 19 + throw "Config for ${filename} not found at ./lua/plugins/${filename}.lua" 20 + else 21 + { 22 + inherit plugin; 23 + type = "lua"; 24 + config = "require 'plugins.${filename}'"; 25 + }; 26 + in 27 + { 24 28 hm.programs.neovim.plugins = with pkgs.vimPlugins; [ 25 29 # UI 26 30 (luaConf catppuccin-nvim "catppuccin")
+2 -1
users/leah/programs/rust/default.nix
··· 3 3 pkgs, 4 4 lib, 5 5 ... 6 - }: { 6 + }: 7 + { 7 8 roles.rust = { 8 9 enable = true; 9 10 settings = {
+12 -15
users/leah/programs/virt-manager/default.nix
··· 1 + { pkgs, lib, ... }: 1 2 { 2 - pkgs, 3 - lib, 4 - ... 5 - }: { 6 - boot.kernelModules = ["vfio-pci"]; 7 - boot.blacklistedKernelModules = ["nouveau"]; 8 - boot.kernelParams = ["intel_iommu=on"]; 3 + boot.kernelModules = [ "vfio-pci" ]; 4 + boot.blacklistedKernelModules = [ "nouveau" ]; 5 + boot.kernelParams = [ "intel_iommu=on" ]; 9 6 10 - services.xserver.videoDrivers = lib.mkForce []; 7 + services.xserver.videoDrivers = lib.mkForce [ ]; 11 8 12 - systemd.tmpfiles.rules = ["f /dev/shm/looking-glass 0660 leah kvm -"]; 9 + systemd.tmpfiles.rules = [ "f /dev/shm/looking-glass 0660 leah kvm -" ]; 13 10 14 - hm.home.packages = [pkgs.looking-glass-client]; 11 + hm.home.packages = [ pkgs.looking-glass-client ]; 15 12 16 - hm.xdg.configFile."looking-glass/client.ini".text = lib.generators.toINI {} { 13 + hm.xdg.configFile."looking-glass/client.ini".text = lib.generators.toINI { } { 17 14 win = { 18 15 size = "1920x1200"; 19 16 autoResize = "yes"; ··· 31 28 qemu = { 32 29 swtpm.enable = true; 33 30 ovmf.enable = true; 34 - ovmf.packages = [pkgs.OVMFFull.fd]; 31 + ovmf.packages = [ pkgs.OVMFFull.fd ]; 35 32 }; 36 33 }; 37 34 spiceUSBRedirection.enable = true; ··· 41 38 42 39 programs.virt-manager.enable = true; 43 40 44 - roles.base.user.extraGroups = ["libvirtd"]; 41 + roles.base.user.extraGroups = [ "libvirtd" ]; 45 42 46 43 environment.systemPackages = with pkgs; [ 47 44 virt-viewer ··· 54 51 55 52 hm.dconf.settings = { 56 53 "org/virt-manager/virt-manager/connections" = { 57 - autoconnect = ["qemu:///system"]; 58 - uris = ["qemu:///system"]; 54 + autoconnect = [ "qemu:///system" ]; 55 + uris = [ "qemu:///system" ]; 59 56 }; 60 57 }; 61 58 }
+1 -5
users/personal.nix
··· 1 - { 2 - imports = [ 3 - ./leah 4 - ]; 5 - } 1 + { imports = [ ./leah ]; }