Move system configs to a separate dir.

This commit is contained in:
Dmitry Voronin 2024-09-30 12:46:36 +03:00
parent 965f1afee7
commit 1a71b2cdc6
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
23 changed files with 22 additions and 44 deletions

View file

@ -148,39 +148,38 @@
)
);
# Nixos systems.
nixosConfigurations = let
# Function to create a host. It does basic setup, like adding common modules.
mkHost = { system, hostname, modules }: let
in nixpkgs.lib.nixosSystem {
mkHost = { system, hostname, modules }: nixpkgs.lib.nixosSystem {
# `Inherit` is just an alias for `system = system;`, which means that
# keep the `system` argument as a property in a resulting set.
inherit system;
# List of modules to use by defualt for all the hosts.
modules = modules ++ [
# There I put host-specific configurations.
./host/${system}/${hostname}
modules = [
# Make a device hostname match the one from this config.
{ networking.hostName = hostname; }
# Specify current release version.
{ system.stateVersion = self.const.stateVersion; }
# Add modules.
{ imports = [ ./home/NixOs.nix ] ++
(self.findFiles ./config) ++
(self.findFiles ./container) ++
(self.findFiles ./module) ++
(self.findFiles ./overlay);
}
# Add Home Manager module.
home-manager.nixosModules.home-manager
# Add Stylix module.
stylix.nixosModules.stylix
];
# HM config.
./home/NixOs.nix
] ++
modules ++
(self.findFiles ./host/${system}/${hostname}) ++
(self.findFiles ./config) ++
(self.findFiles ./container) ++
(self.findFiles ./module) ++
(self.findFiles ./system) ++
(self.findFiles ./overlay);
# SpecialArgs allows you to pass objects down to other NixOS modules.
specialArgs = let
@ -241,7 +240,7 @@
inherit self inputs secret util pkgs pkgsStable pkgsMaster;
inherit (self) const __findFile;
};
modules = modules ++ (self.findFiles ./config) ++ [
modules = [
./home/HomeManager.nix
{
home.hm = {
@ -259,7 +258,10 @@
{ nix.settings.experimental-features = [ "nix-command " "flakes" ]; }
inputs.stylix.homeManagerModules.stylix
];
] ++
modules ++
(self.findFiles ./config) ++
(self.findFiles ./module);
};
};
@ -303,7 +305,8 @@
inherit (self) __findFile;
inherit lib pkgs;
})
];
] ++
(self.findFiles ./module);
# SpecialArgs allows you to pass objects down to other configuration.
extraSpecialArgs = {

View file

@ -27,6 +27,6 @@ in {
text = (util.trimTabs ''
# Read `man 5 sway` for a complete reference.
include /etc/sway/config.d/*
'') + swayRc + config.module.desktop.sway.extraConfig or "";
'') + swayRc + config.module.desktop.sway.extraConfig;
}

View file

@ -1,8 +1,4 @@
{ ... }: {
imports = [
./Filesystem.nix
];
home.nixos.enable = true;
user = {
dasha.enable = true;

View file

@ -1,8 +1,4 @@
{ ... }: {
imports = [
./Filesystem.nix
];
home.nixos.enable = true;
user = {
root.enable = true;

View file

@ -1,13 +1,4 @@
{ config, ... }: {
imports = [
./Backup.nix
./Container.nix
./Filesystem.nix
./Network.nix
./Photoprocess.nix
./YaMusicDownload.nix
];
home.nixos.enable = true;
user = {
root.enable = true;

View file

@ -1,8 +1,4 @@
{ ... }: {
imports = [
./Filesystem.nix
];
home.nixos.enable = true;
user = {
dasha.enable = true;

View file

@ -1,8 +1,4 @@
{ ... }: {
imports = [
./Fprint.nix
];
# Keyd Print to Macro remap.
services.keyd.keyboards.default.settings.main.print = "layer(layer_number)";