diff options
author | Azat Bahawi <azat@bahawi.net> | 2024-04-21 02:15:42 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2024-04-21 02:15:42 +0300 |
commit | e6ed60548397627bf10f561f9438201dbba0a36e (patch) | |
tree | f9a84c5957d2cc4fcd148065ee9365a0c851ae1c /modules/nixos/common | |
parent | 2024-04-18 (diff) |
2024-04-21
Diffstat (limited to '')
-rw-r--r-- | modules/common/ark.nix (renamed from modules/nixos/common/ark.nix) | 2 | ||||
-rw-r--r-- | modules/common/console.nix (renamed from modules/nixos/common/console.nix) | 0 | ||||
-rw-r--r-- | modules/common/documentation.nix (renamed from modules/nixos/common/documentation.nix) | 11 | ||||
-rw-r--r-- | modules/common/kernel.nix (renamed from modules/nixos/common/kernel.nix) | 0 | ||||
-rw-r--r-- | modules/common/locale.nix (renamed from modules/nixos/common/locale.nix) | 5 | ||||
-rw-r--r-- | modules/common/networking.nix (renamed from modules/nixos/common/networking.nix) | 1 | ||||
-rw-r--r-- | modules/common/security.nix (renamed from modules/nixos/common/security.nix) | 0 | ||||
-rw-r--r-- | modules/common/services.nix (renamed from modules/nixos/common/services.nix) | 0 | ||||
-rw-r--r-- | modules/common/systemd.nix (renamed from modules/nixos/common/systemd.nix) | 0 | ||||
-rw-r--r-- | modules/common/tmp.nix (renamed from modules/nixos/common/tmp.nix) | 0 | ||||
-rw-r--r-- | modules/common/users.nix (renamed from modules/nixos/common/users.nix) | 18 | ||||
-rw-r--r-- | modules/nixos/common/default.nix | 21 | ||||
-rw-r--r-- | modules/nixos/common/home-manager.nix | 4 | ||||
-rw-r--r-- | modules/nixos/common/nix.nix | 35 | ||||
-rw-r--r-- | modules/nixos/common/secrets.nix | 4 | ||||
-rw-r--r-- | modules/nixos/common/shell.nix | 1 | ||||
-rw-r--r-- | modules/nixos/common/stylix.nix | 46 | ||||
-rw-r--r-- | modules/nixos/common/xdg.nix | 41 |
18 files changed, 28 insertions, 161 deletions
diff --git a/modules/nixos/common/ark.nix b/modules/common/ark.nix index 6c7148f..84ff6db 100644 --- a/modules/nixos/common/ark.nix +++ b/modules/common/ark.nix @@ -10,12 +10,12 @@ let in { imports = [ + inputs.impermanence.nixosModules.impermanence (mkAliasOptionModule [ "ark" ] [ "nixfiles" "modules" "ark" ]) - inputs.impermanence.nixosModules.impermanence ]; options.nixfiles.modules.ark = diff --git a/modules/nixos/common/console.nix b/modules/common/console.nix index 330310c..330310c 100644 --- a/modules/nixos/common/console.nix +++ b/modules/common/console.nix diff --git a/modules/nixos/common/documentation.nix b/modules/common/documentation.nix index f7d1585..20856cb 100644 --- a/modules/nixos/common/documentation.nix +++ b/modules/common/documentation.nix @@ -7,9 +7,18 @@ }: with lib; { - config = mkIf this.isHeadful { + config = { + hm.manual = { + manpages.enable = this.isHeadful; + html.enable = false; + json.enable = false; + }; + documentation = { + enable = this.isHeadful; dev.enable = true; + doc.enable = false; + info.enable = false; nixos.enable = true; man.man-db.manualPages = diff --git a/modules/nixos/common/kernel.nix b/modules/common/kernel.nix index 5c45b5d..5c45b5d 100644 --- a/modules/nixos/common/kernel.nix +++ b/modules/common/kernel.nix diff --git a/modules/nixos/common/locale.nix b/modules/common/locale.nix index 8b91a5a..7e8eefb 100644 --- a/modules/nixos/common/locale.nix +++ b/modules/common/locale.nix @@ -6,6 +6,11 @@ }: with lib; { + hm.home.language = { + collate = "C"; + messages = "C"; + }; + i18n = { defaultLocale = mkDefault "en_GB.UTF-8"; supportedLocales = [ diff --git a/modules/nixos/common/networking.nix b/modules/common/networking.nix index ecadf6e..727def4 100644 --- a/modules/nixos/common/networking.nix +++ b/modules/common/networking.nix @@ -123,6 +123,7 @@ in systemPackages = with pkgs; [ ethtool + myip nethogs ]; }; diff --git a/modules/nixos/common/security.nix b/modules/common/security.nix index c635cdc..c635cdc 100644 --- a/modules/nixos/common/security.nix +++ b/modules/common/security.nix diff --git a/modules/nixos/common/services.nix b/modules/common/services.nix index 12e4bf7..12e4bf7 100644 --- a/modules/nixos/common/services.nix +++ b/modules/common/services.nix diff --git a/modules/nixos/common/systemd.nix b/modules/common/systemd.nix index b393d9f..b393d9f 100644 --- a/modules/nixos/common/systemd.nix +++ b/modules/common/systemd.nix diff --git a/modules/nixos/common/tmp.nix b/modules/common/tmp.nix index d56e2b6..d56e2b6 100644 --- a/modules/nixos/common/tmp.nix +++ b/modules/common/tmp.nix diff --git a/modules/nixos/common/users.nix b/modules/common/users.nix index a92a38e..ba1a89b 100644 --- a/modules/nixos/common/users.nix +++ b/modules/common/users.nix @@ -1,13 +1,17 @@ -{ - lib, - localUsername ? lib.my.username, - ... -}: +{ lib, ... }: with lib; let - home = "/home/${localUsername}"; + home = "/home/${my.username}"; in { + imports = [ + (mkAliasOptionModule [ "my" ] [ + "users" + "users" + my.username + ]) + ]; + ark.directories = [ home ]; users = { @@ -16,7 +20,7 @@ in users = { root.hashedPassword = "@HASHED_PASSWORD@"; - ${localUsername} = { + ${my.username} = { isNormalUser = true; uid = 1000; description = my.fullname; diff --git a/modules/nixos/common/default.nix b/modules/nixos/common/default.nix deleted file mode 100644 index 4c192c9..0000000 --- a/modules/nixos/common/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -_: { - imports = [ - ./ark.nix - ./console.nix - ./documentation.nix - ./home-manager.nix - ./kernel.nix - ./locale.nix - ./networking.nix - ./nix.nix - ./secrets.nix - ./security.nix - ./services.nix - ./shell.nix - ./stylix.nix - ./systemd.nix - ./tmp.nix - ./users.nix - ./xdg.nix - ]; -} diff --git a/modules/nixos/common/home-manager.nix b/modules/nixos/common/home-manager.nix deleted file mode 100644 index c553a65..0000000 --- a/modules/nixos/common/home-manager.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ inputs, ... }: -{ - imports = [ inputs.home-manager.nixosModule ]; -} diff --git a/modules/nixos/common/nix.nix b/modules/nixos/common/nix.nix deleted file mode 100644 index 146575d..0000000 --- a/modules/nixos/common/nix.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - config, - inputs, - lib, - ... -}: -with lib; -let - cfg = config.nixfiles.modules.common.nix; -in -{ - options.nixfiles.modules.common.nix.allowedUnfreePackages = mkOption { - description = "A list of allowed unfree packages."; - type = with types; listOf str; - default = [ ]; - }; - - config = { - nix = { - daemonCPUSchedPolicy = "idle"; - daemonIOSchedClass = "idle"; - daemonIOSchedPriority = 7; - }; - - nixpkgs.config.allowUnfreePredicate = p: elem (getName p) cfg.allowedUnfreePackages; - - system.stateVersion = with builtins; head (split "\n" (readFile "${inputs.nixpkgs}/.version")); - - environment = { - sessionVariables.NIX_SHELL_PRESERVE_PROMPT = "1"; - localBinInPath = true; - defaultPackages = [ ]; - }; - }; -} diff --git a/modules/nixos/common/secrets.nix b/modules/nixos/common/secrets.nix deleted file mode 100644 index 31787ac..0000000 --- a/modules/nixos/common/secrets.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ inputs, ... }: -{ - imports = [ inputs.agenix.nixosModules.default ]; -} diff --git a/modules/nixos/common/shell.nix b/modules/nixos/common/shell.nix deleted file mode 100644 index a1a7f08..0000000 --- a/modules/nixos/common/shell.nix +++ /dev/null @@ -1 +0,0 @@ -_: { programs.command-not-found.enable = false; } diff --git a/modules/nixos/common/stylix.nix b/modules/nixos/common/stylix.nix deleted file mode 100644 index 58b4f29..0000000 --- a/modules/nixos/common/stylix.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: -with lib; -{ - imports = [ inputs.stylix.nixosModules.stylix ]; - - stylix.cursor = { - name = "phinger-cursors-light"; - package = pkgs.phinger-cursors; - size = 32; - }; - - fonts = { - packages = mkAfter config.nixfiles.modules.common.stylix.fonts.extraPackages; - - fontconfig.defaultFonts = with config.stylix.fonts; { - serif = mkForce [ - serif.name - "Sarasa Gothic" - "Source Han Serif" - "Noto Serif" - ]; - sansSerif = mkForce [ - sansSerif.name - "Sarasa Gothic" - "Source Han Sans" - "Noto Sans" - ]; - monospace = mkForce [ - monospace.name - "Sarasa Mono" - "Source Han Mono" - "Noto Sans Mono" - ]; - emoji = mkForce [ - "Twitter Color Emoji" - "Noto Color Emoji" - ]; - }; - }; -} diff --git a/modules/nixos/common/xdg.nix b/modules/nixos/common/xdg.nix deleted file mode 100644 index 1fe167e..0000000 --- a/modules/nixos/common/xdg.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - config, - lib, - this, - ... -}: -with lib; -let - cfg = config.nixfiles.modules.common.xdg; -in -{ - options.nixfiles.modules.common.xdg.defaultApplications = mkOption { - description = "Default applications."; - type = with types; attrsOf (listOf str); - default = { }; - }; - - config = { - xdg.portal = mkIf this.isHeadful { enable = true; }; - - hm.xdg = mkMerge [ - (with cfg; { - enable = true; - - inherit cacheHome; - inherit configHome; - inherit dataHome; - inherit stateHome; - inherit userDirs; - }) - (mkIf this.isHeadful { - mimeApps = { - enable = true; - defaultApplications = mkMerge ( - mapAttrsToList (n: v: genAttrs v (_: [ "${n}.desktop" ])) cfg.defaultApplications - ); - }; - }) - ]; - }; -} |