diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-05-16 16:45:40 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-05-16 16:45:40 +0200 |
commit | 176d9bb96e8923b84bb0bdc731ef707514c0d53e (patch) | |
tree | cab831d04c6c919d41c11fe6abfe67de34c90699 /hosts | |
parent | modules: Import external modules in the module that actually need them (diff) | |
download | nixos-config-176d9bb96e8923b84bb0bdc731ef707514c0d53e.zip |
hosts: Move to a `by-name` schema
Diffstat (limited to '')
-rw-r--r-- | hosts/by-name/apzu/configuration.nix (renamed from hosts/apzu/default.nix) | 7 | ||||
-rw-r--r-- | hosts/by-name/apzu/hardware.nix (renamed from hosts/apzu/hardware.nix) | 0 | ||||
-rw-r--r-- | hosts/by-name/tiamat/configuration.nix (renamed from hosts/tiamat/default.nix) | 25 | ||||
-rw-r--r-- | hosts/by-name/tiamat/hardware.nix (renamed from hosts/tiamat/hardware.nix) | 0 | ||||
-rw-r--r-- | hosts/default.nix | 61 |
5 files changed, 87 insertions, 6 deletions
diff --git a/hosts/apzu/default.nix b/hosts/by-name/apzu/configuration.nix index 96dd99e1..69af3f2d 100644 --- a/hosts/apzu/default.nix +++ b/hosts/by-name/apzu/configuration.nix @@ -24,6 +24,13 @@ backlight = "intel_backlight"; enable = true; }; + + # TODO: Hard-code all the uids/gids <2025-05-13> + impermanence.directories = [ + "/var/lib/nixos" + "/var/log" + ]; + programs = { yambar = { laptop = true; diff --git a/hosts/apzu/hardware.nix b/hosts/by-name/apzu/hardware.nix index 8d481fa6..8d481fa6 100644 --- a/hosts/apzu/hardware.nix +++ b/hosts/by-name/apzu/hardware.nix diff --git a/hosts/tiamat/default.nix b/hosts/by-name/tiamat/configuration.nix index 794b8390..3e7349ce 100644 --- a/hosts/tiamat/default.nix +++ b/hosts/by-name/tiamat/configuration.nix @@ -10,9 +10,9 @@ { lib, pkgs, - baseLib, - qmk_firmware, system, + libraries, + externalBinaries, ... }: { imports = [ @@ -30,6 +30,13 @@ enable = true; systemName = "x86_64-linux"; }; + + # TODO: Hard-code all the uids/gids <2025-05-13> + impermanence.directories = [ + "/var/lib/nixos" + "/var/log" + ]; + services = { unison.foreign.address = "apzu.fritz.box"; }; @@ -85,16 +92,22 @@ # "Y" = {command = ["spawn" "bemenu-run"];}; # Toggle all tags - "0" = {command = ["set-focused-tags" "${builtins.toString ((baseLib.pow 2 32) - 1)}"];}; + "0" = {command = ["set-focused-tags" "${builtins.toString ((libraries.base.pow 2 32) - 1)}"];}; # Support Unicode input - "Z" = {command = ["spawn" "${lib.getExe qmk_firmware.packages.${system}.qmk_unicode_type} 106 65377"];}; + "Z" = {command = ["spawn" "${lib.getExe externalBinaries.qmk_firmware.packages.${system}.qmk_unicode_type} 106 65377"];}; }) // ({ # TODO: add toggle-focus mapping # Toggle all tags - "<Alt+Ctrl+Shift-0>" = {command = ["set-view-tags" "${builtins.toString ((baseLib.pow 2 32) - 1)}"];}; + "<Alt+Ctrl+Shift-0>" = { + command = [ + "set-view-tags" + "${builtins.toString + ((libraries.base.pow 2 32) - 1)}" + ]; + }; # Mouse "<Meta-<MOUSE_LEFT>>" = { @@ -110,7 +123,7 @@ builtins.foldl' (acc: elem: acc // elem) {} ( builtins.map (index: let num = builtins.toString index; - index2tag = input: builtins.toString (baseLib.pow 2 (input - 1)); + index2tag = input: builtins.toString (libraries.base.pow 2 (input - 1)); in { "${map num}" = {command = ["set-focused-tags" (index2tag index)];}; "<Alt+Ctrl+Shift-${num}>" = {command = ["set-view-tags" (index2tag index)];}; diff --git a/hosts/tiamat/hardware.nix b/hosts/by-name/tiamat/hardware.nix index 2b18a662..2b18a662 100644 --- a/hosts/tiamat/hardware.nix +++ b/hosts/by-name/tiamat/hardware.nix diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 00000000..35b2d08b --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,61 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + self, + system, + openPRsNixpkgs, + packageSets, + libraries, + modules, + externalDependencies, + externalBinaries, +}: let + hosts = libraries.extra.mkByName { + useShards = false; + baseDirectory = ./by-name; + fileName = "configuration.nix"; + }; + + generateHost = _: path: + self.inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit + libraries + modules + ; + }; + modules = [ + { + _module.args = { + inherit + # extra package sources + openPRsNixpkgs + packageSets + # extra information + system + # nix registry + self + externalDependencies + # bins + # TODO: Integrate these into `pkgs/by-name` <2024-05-22> + externalBinaries + ; + }; + } + path + + ../modules + ../modules/common + ]; + }; + + generatedHosts = builtins.mapAttrs generateHost hosts; +in + generatedHosts |