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

View file

@ -27,6 +27,6 @@ in {
text = (util.trimTabs '' text = (util.trimTabs ''
# Read `man 5 sway` for a complete reference. # Read `man 5 sway` for a complete reference.
include /etc/sway/config.d/* 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; home.nixos.enable = true;
user = { user = {
dasha.enable = true; dasha.enable = true;

View file

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

View file

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

View file

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

View file

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