cleaned up flake.nix

This commit is contained in:
Aleksandr Lebedev 2024-12-20 11:51:30 +01:00
parent 54cd41fc40
commit 8da38ec270
8 changed files with 36 additions and 39 deletions

View file

@ -33,7 +33,7 @@
impermanence.url = "github:nix-community/impermanence"; impermanence.url = "github:nix-community/impermanence";
}; };
outputs = { self, nixpkgs, stylix, nixvim, ... }@inputs: outputs = { self, nixpkgs, ... }@inputs:
let let
#systems = ["aarch64-linux" "x86_64-linux" ]; #systems = ["aarch64-linux" "x86_64-linux" ];
#forAllSystems = nixpkgs.lib.genAttrs systems; #forAllSystems = nixpkgs.lib.genAttrs systems;
@ -43,17 +43,10 @@
# allowUnfree = true; # allowUnfree = true;
# }; # };
#}; #};
arm = "aarch64-linux"; arm = "aarch64-linux";
x86 = "x86_64-linux"; x86 = "x86_64-linux";
general-modules = [ first-nixos-install = "1729112485"; #stat -c %W /
inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.default
stylix.nixosModules.stylix
inputs.nixos-facter-modules.nixosModules.facter
];
first-nixos-install = "1729112485"; #stat -c %W /
in in
{ {
nixosConfigurations = { nixosConfigurations = {
@ -78,16 +71,10 @@
# }; # };
# }; # };
modules = [ modules = [
inputs.impermanence.nixosModules.impermanence
inputs.disko.nixosModules.default
(import ./nixos/modules/disko/impermanence-disko.nix { device = "/dev/nvme0n1"; } ) (import ./nixos/modules/disko/impermanence-disko.nix { device = "/dev/nvme0n1"; } )
./nixos/modules/impermanence
#nur.nixosModules.nur
./nixos/configuration.nix ./nixos/configuration.nix
./nixos/hardware/nvidia.nix
#./nixos/homepc-hardware-conf.nix
#nix-flatpak.nixosModules.default #nix-flatpak.nixosModules.default
] ++ general-modules; ];
}; };
"kylekrein-mac" = nixpkgs.lib.nixosSystem { "kylekrein-mac" = nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
@ -112,10 +99,8 @@
# }; # };
# }; # };
modules = [ modules = [
inputs.impermanence.nixosModules.impermanence
./nixos/configuration.nix ./nixos/configuration.nix
./nixos/modules/impermanence ];
] ++ general-modules;
}; };
}; };
}; };

View file

@ -2,17 +2,24 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, lib, pkgs, stylix, hwconfig, first-nixos-install, nixvim, inputs, ... }: { config, lib, pkgs, hwconfig, first-nixos-install, inputs, ... }:
{ {
imports = imports =
[ # Include the results of the hardware scan. [
inputs.home-manager.nixosModules.default inputs.sops-nix.nixosModules.sops
inputs.nixvim.nixosModules.nixvim inputs.home-manager.nixosModules.default
./modules/firefox inputs.stylix.nixosModules.stylix
./modules/services/autoupgrade inputs.nixos-facter-modules.nixosModules.facter
./modules/sops inputs.home-manager.nixosModules.default
./hosts/${hwconfig.hostname} inputs.nixvim.nixosModules.nixvim
]; inputs.disko.nixosModules.default
./modules/firefox
./modules/services/autoupgrade
./modules/sops
./hosts/${hwconfig.hostname}
]
++ lib.optional (hwconfig.useImpermanence) ./modules/impermanence;
facter.reportPath = ./hosts/${hwconfig.hostname}/facter.json; facter.reportPath = ./hosts/${hwconfig.hostname}/facter.json;
kylekrein.services.autoUpgrade = { kylekrein.services.autoUpgrade = {
enable = true; enable = true;
@ -22,6 +29,8 @@
}; };
boot = { boot = {
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
plymouth = { plymouth = {
enable = true; enable = true;
}; };
@ -273,7 +282,7 @@
}; };
home-manager = { home-manager = {
extraSpecialArgs = {inherit pkgs; inherit hwconfig; inherit first-nixos-install; inherit nixvim; inherit inputs;}; extraSpecialArgs = {inherit pkgs; inherit hwconfig; inherit first-nixos-install; inherit inputs;};
}; };
stylix = { stylix = {
enable = true; enable = true;

View file

@ -1,6 +1,5 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
boot.kernelPackages = pkgs.linuxPackages_latest;
hardware = { hardware = {
graphics = { graphics = {
enable = true; enable = true;

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, stylix, hwconfig, first-nixos-install, username, inputs, ... }: { config, lib, pkgs, hwconfig, first-nixos-install, username, inputs, ... }:
let let
in in

View file

@ -1,6 +1,8 @@
{ pkgs, lib, hwconfig, inputs, ... }: { pkgs, lib, hwconfig, inputs, ... }:
{ {
imports = [ imports = [
../../hardware/nvidia
../../modules/hyprland ../../modules/hyprland
../../modules/libvirt ../../modules/libvirt

View file

@ -1,6 +1,8 @@
{ lib, ... }: { lib, inputs, ... }:
{ {
imports = [
inputs.impermanence.nixosModules.impermanence
];
fileSystems."/persist".neededForBoot = true; fileSystems."/persist".neededForBoot = true;
environment.persistence."/persist/system" = { environment.persistence."/persist/system" = {
hideMounts = true; hideMounts = true;

View file

@ -1,4 +1,4 @@
{ pkgs, config, lib, hwconfig, inputs, stylix, first-nixos-install, ... }: { pkgs, config, lib, hwconfig, inputs, first-nixos-install, ... }:
let username = "kylekrein"; let username = "kylekrein";
in in
{ {
@ -18,7 +18,7 @@ in
}; };
}; };
home-manager.users."${username}" = import ../../home.nix { inherit lib; inherit username; inherit inputs; inherit stylix; inherit first-nixos-install; inherit hwconfig; inherit config; inherit pkgs; }; home-manager.users."${username}" = import ../../home.nix { inherit lib; inherit username; inherit inputs; inherit first-nixos-install; inherit hwconfig; inherit config; inherit pkgs; };
kylekrein.services.autoUpgrade = { kylekrein.services.autoUpgrade = {
configDir = lib.mkForce "/home/${username}/nixos-config"; configDir = lib.mkForce "/home/${username}/nixos-config";
user = lib.mkForce username; user = lib.mkForce username;

View file

@ -1,4 +1,4 @@
{ pkgs, config, lib, hwconfig, inputs, stylix, first-nixos-install, ... }: { pkgs, config, lib, hwconfig, inputs, first-nixos-install, ... }:
let username = "tania"; let username = "tania";
in in
{ {
@ -20,6 +20,6 @@ in
}; };
}; };
home-manager.users."${username}" = import ../../home.nix { inherit lib; inherit username; inherit inputs; inherit stylix; inherit first-nixos-install; inherit hwconfig; inherit config; inherit pkgs; }; home-manager.users."${username}" = import ../../home.nix { inherit lib; inherit username; inherit inputs; inherit first-nixos-install; inherit hwconfig; inherit config; inherit pkgs; };
systemd.tmpfiles.rules = (if hwconfig.useImpermanence then ["d /persist/home/${username} 0700 ${username} users -"] else []); # /persist/home/<user> created, owned by that user systemd.tmpfiles.rules = (if hwconfig.useImpermanence then ["d /persist/home/${username} 0700 ${username} users -"] else []); # /persist/home/<user> created, owned by that user
} }