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";
};
outputs = { self, nixpkgs, stylix, nixvim, ... }@inputs:
outputs = { self, nixpkgs, ... }@inputs:
let
#systems = ["aarch64-linux" "x86_64-linux" ];
#forAllSystems = nixpkgs.lib.genAttrs systems;
@ -43,17 +43,10 @@
# allowUnfree = true;
# };
#};
arm = "aarch64-linux";
x86 = "x86_64-linux";
arm = "aarch64-linux";
x86 = "x86_64-linux";
general-modules = [
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 /
first-nixos-install = "1729112485"; #stat -c %W /
in
{
nixosConfigurations = {
@ -78,16 +71,10 @@
# };
# };
modules = [
inputs.impermanence.nixosModules.impermanence
inputs.disko.nixosModules.default
(import ./nixos/modules/disko/impermanence-disko.nix { device = "/dev/nvme0n1"; } )
./nixos/modules/impermanence
#nur.nixosModules.nur
./nixos/configuration.nix
./nixos/hardware/nvidia.nix
#./nixos/homepc-hardware-conf.nix
#nix-flatpak.nixosModules.default
] ++ general-modules;
];
};
"kylekrein-mac" = nixpkgs.lib.nixosSystem {
specialArgs = {
@ -112,10 +99,8 @@
# };
# };
modules = [
inputs.impermanence.nixosModules.impermanence
./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
# 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 =
[ # Include the results of the hardware scan.
inputs.home-manager.nixosModules.default
inputs.nixvim.nixosModules.nixvim
./modules/firefox
./modules/services/autoupgrade
./modules/sops
./hosts/${hwconfig.hostname}
];
[
inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.default
inputs.stylix.nixosModules.stylix
inputs.nixos-facter-modules.nixosModules.facter
inputs.home-manager.nixosModules.default
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;
kylekrein.services.autoUpgrade = {
enable = true;
@ -22,6 +29,8 @@
};
boot = {
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
plymouth = {
enable = true;
};
@ -273,7 +282,7 @@
};
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 = {
enable = true;

View file

@ -1,6 +1,5 @@
{ config, pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_latest;
hardware = {
graphics = {
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
in

View file

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

View file

@ -1,6 +1,8 @@
{ lib, ... }:
{ lib, inputs, ... }:
{
imports = [
inputs.impermanence.nixosModules.impermanence
];
fileSystems."/persist".neededForBoot = true;
environment.persistence."/persist/system" = {
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";
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 = {
configDir = lib.mkForce "/home/${username}/nixos-config";
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";
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
}