mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
cleaned up lib and modules/misc
This commit is contained in:
parent
f2974e6b13
commit
da8e226c3a
7 changed files with 55 additions and 52 deletions
|
|
@ -5,29 +5,31 @@ inputs @ {
|
|||
}: let
|
||||
inherit (unstable) lib;
|
||||
|
||||
listNixFilesRecursive = path:
|
||||
builtins.filter (lib.hasSuffix "nix")
|
||||
(lib.filesystem.listFilesRecursive path);
|
||||
|
||||
importAll = path:
|
||||
map
|
||||
(module: (import module inputs))
|
||||
(
|
||||
builtins.filter (lib.hasSuffix ".nix")
|
||||
(lib.filesystem.listFilesRecursive path)
|
||||
);
|
||||
(listNixFilesRecursive path);
|
||||
|
||||
mkModules = path:
|
||||
lib.listToAttrs (
|
||||
map (
|
||||
name: {
|
||||
name = lib.removePrefix (toString path + "/") (lib.removeSuffix ".nix" (toString name));
|
||||
name = lib.pipe name [
|
||||
toString
|
||||
(lib.removePrefix "${path}/")
|
||||
(lib.removeSuffix ".nix")
|
||||
];
|
||||
value = import name inputs;
|
||||
}
|
||||
)
|
||||
(
|
||||
builtins.filter (lib.hasSuffix ".nix")
|
||||
(lib.filesystem.listFilesRecursive path)
|
||||
)
|
||||
(listNixFilesRecursive path)
|
||||
);
|
||||
in {
|
||||
inherit importAll mkModules;
|
||||
inherit importAll mkModules listNixFilesRecursive;
|
||||
|
||||
withSystem = f:
|
||||
lib.fold lib.recursiveUpdate {}
|
||||
|
|
@ -39,12 +41,13 @@ in {
|
|||
lib.nixosSystem {
|
||||
inherit system;
|
||||
modules =
|
||||
builtins.attrValues self.nixosModules ++ importAll (self + "/hosts/" + name);
|
||||
builtins.attrValues self.nixosModules
|
||||
++ importAll "${self}/hosts/${name}";
|
||||
}
|
||||
);
|
||||
mkDisko = names:
|
||||
lib.genAttrs names (
|
||||
name: (import (self + "/hosts/" + name + "/disko.nix") inputs)
|
||||
name: (import "${self}/hosts/${name}/disko.nix" inputs)
|
||||
);
|
||||
|
||||
mkPkgs = pkgs: path:
|
||||
|
|
@ -53,9 +56,6 @@ in {
|
|||
name = lib.removeSuffix ".nix" (builtins.baseNameOf module);
|
||||
value = pkgs.callPackage module {};
|
||||
})
|
||||
(
|
||||
builtins.filter (lib.hasSuffix ".nix")
|
||||
(lib.filesystem.listFilesRecursive path)
|
||||
)
|
||||
(listNixFilesRecursive path)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
enable = true;
|
||||
displayManager = {
|
||||
sessionCommands = ''
|
||||
${lib.getExe pkgs.feh} --bg-center ${self.packages.${pkgs.system}.images + /recursion.png}
|
||||
${lib.getExe pkgs.feh} --bg-center "${self.packages.${pkgs.system}.images}/recursion.png"
|
||||
${lib.getExe pkgs.numlockx}
|
||||
${lib.getExe pkgs.picom} &
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
displayManager = {
|
||||
lightdm = {
|
||||
enable = true;
|
||||
background = self.packages.${pkgs.system}.images + /recursion.png;
|
||||
background = "${self.packages.${pkgs.system}.images}/recursion.png";
|
||||
extraConfig = "minimum-vt=1";
|
||||
greeters.mini = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
plymouth = {
|
||||
enable = lib.mkDefault true;
|
||||
theme = "breeze";
|
||||
logo = self.packages.${pkgs.system}.images + /logo.png;
|
||||
logo = "${self.packages.${pkgs.system}.images}/logo.png";
|
||||
};
|
||||
loader = {
|
||||
grub.configurationLimit = 10;
|
||||
|
|
|
|||
|
|
@ -15,20 +15,21 @@ _: {
|
|||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf (config.nixpkgs.allowedUnfree != []) {
|
||||
config = {
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.nixpkgs.allowedUnfree;
|
||||
})
|
||||
{
|
||||
environment.defaultPackages = lib.mkForce [
|
||||
pkgs.efibootmgr #efi editor
|
||||
pkgs.pciutils #lspci
|
||||
pkgs.alsa-utils #volume control
|
||||
pkgs.xclip #commandline clipboard access
|
||||
pkgs.bottom #view tasks
|
||||
pkgs.nix-tree #view packages
|
||||
pkgs.nix-output-monitor #nom nom nom nom];
|
||||
];
|
||||
|
||||
environment.defaultPackages = lib.mkForce (builtins.attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
alsa-utils #volume control
|
||||
bottom #view tasks
|
||||
efibootmgr #efi editor
|
||||
nix-output-monitor #nom nom nom nom;
|
||||
nix-tree #view packages
|
||||
pciutils #lspci
|
||||
xclip #commandline clipboard access
|
||||
;
|
||||
});
|
||||
|
||||
#enable ssh
|
||||
programs.mtr.enable = true; #ping and traceroute
|
||||
|
|
@ -44,6 +45,5 @@ _: {
|
|||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
#time settings
|
||||
time.timeZone = "America/New_York";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@ inputs: {pkgs, ...}: {
|
|||
nix = {
|
||||
package = inputs.nix.packages.${pkgs.system}.default;
|
||||
settings = {
|
||||
experimental-features = ["nix-command" "flakes" "repl-flake"];
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
"repl-flake"
|
||||
];
|
||||
auto-optimise-store = true;
|
||||
warn-dirty = false;
|
||||
#ignore global registry
|
||||
|
|
@ -14,8 +18,7 @@ inputs: {pkgs, ...}: {
|
|||
"root"
|
||||
"@wheel"
|
||||
];
|
||||
allowed-users = [
|
||||
];
|
||||
allowed-users = [];
|
||||
use-xdg-base-directories = true;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
pkgs.sops
|
||||
];
|
||||
sops = {
|
||||
defaultSopsFile = self + "/hosts/" + config.networking.hostName + "/secrets.yaml";
|
||||
defaultSopsFile = "${self}/hosts/${config.networking.hostName}/secrets.yaml";
|
||||
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue