This commit is contained in:
iFargle 2023-08-15 18:24:07 +09:00
parent 4262282b69
commit 20b02047f6
4 changed files with 32 additions and 46 deletions

View file

@ -22,7 +22,6 @@
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# Encrypted secrets in Nix configuration files # Encrypted secrets in Nix configuration files
# https://github.com/Mic92/sops-nix
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
}; };
@ -58,8 +57,8 @@
}; };
modules = [ modules = [
# Configuration Imports # Configuration Imports
./configuration.nix { inherit pkgs hostname config; }# Common NixOS Configuration ./configuration.nix # Common NixOS Configuration
./hosts/${hostname}/flake.nix { inherit pkgs hostname config; }# Hardware-specific Configuration ./hosts/${hostname} # Hardware-specific Configuration
# Flake Imports # Flake Imports
sops-nix.nixosModules.sops # Handle secrets sops-nix.nixosModules.sops # Handle secrets
@ -69,18 +68,20 @@
# Home Manager settings # Home Manager settings
home-manager.nixosModules.home-manager { home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true; home-manager = {
home-manager.useUserPackages = true; useGlobalPkgs = true;
home-manager.users.albert.imports = [ useUserPackages = true;
users.albert.imports = [
({ config, ... }: import ./users/albert/home.nix { ({ config, ... }: import ./users/albert/home.nix {
inherit config pkgs hostname; inherit config pkgs hostname;
}) })
]; ];
home-manager.users.root.imports = [ users.root.imports = [
({ config, ... }: import ./users/root/home.nix { ({ config, ... }: import ./users/root/home.nix {
inherit config pkgs hostname; inherit config pkgs hostname;
}) })
]; ];
}; # home-manager
nixpkgs.overlays = [ nixpkgs.overlays = [
nur.overlay nur.overlay
]; ];
@ -88,5 +89,5 @@
]; # modules ]; # modules
}; # lib.nixosSystem - ${hostname} }; # lib.nixosSystem - ${hostname}
}; # nixosConfiguration }; # nixosConfiguration
}; }; # in
} }

View file

@ -0,0 +1,7 @@
{ imports, ... }: {
imports = [
imports.nixos-hardware.nixosModules.lenovo-thinkpad-p1
./home-manager
./nixos
];
}

View file

@ -1,29 +0,0 @@
{
# INFORMATION
# When building for a system, remember to change the hostname variable below
description = "nixos-laptop flake";
inputs = {
# Hardware support
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
};
outputs = { hostname, nixos-hardware, ... }@inputs: {
# NixOS Configuration files:
nixosConfigurations = {
# Declare a generic configuration using the $hostname variable:
"nixos-laptop" = unstable-nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit hostname;
};
modules = [
# Configuration Imports
./nixos/configuration.nix
# Flake Imports
nixos-hardware.nixosModules.lenovo-thinkpad-p1
]; # modules
}; # lib.nixosSystem - "nixos-laptop"
}; # nixosConfiguration
}; # outputs
} # flake

View file

@ -0,0 +1,7 @@
{ config, pkgs, hostname, ... }: {
imports = [
./hardware-configuration.nix
./configuration.nix
./networking.nix
];
}