refactor for adding new hosts

This commit is contained in:
Sam 2024-05-13 22:17:40 +01:00
parent 651e3a9f3b
commit 154d7b0528
10 changed files with 54 additions and 16 deletions

View File

@ -38,6 +38,7 @@
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;
specialArgs = { inherit inputs outputs; };
in {
# Your custom packages
# Accessible through 'nix build', 'nix shell', etc
@ -60,26 +61,37 @@
nixosConfigurations = {
# FIXME replace with your hostname
nixdev = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
inherit specialArgs;
modules = [
# > Our main nixos configuration file <
./hosts/nixdev
home-manager.nixosModules.home-manager{
home-manager.extraSpecialArgs = specialArgs;
}
];
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
# FIXME replace with your username@hostname
"sam@nixdev" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs ;};
modules = [
# > Our main home-manager configuration file <
./home/sam/nixdev.nix
];
};
};
# # Standalone home-manager configuration entrypoint
# # Available through 'home-manager --flake .#your-username@your-hostname'
# homeConfigurations = {
# # FIXME replace with your username@hostname
# "sam@nixdev" = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
# extraSpecialArgs = {inherit inputs outputs ;};
# modules = [
# # > Our main home-manager configuration file <
# ./home/nixdev.nix
# ];
# };
# "admin@fileserver" = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
# extraSpecialArgs = {inherit inputs outputs ;};
# modules = [
# # > Our main home-manager configuration file <
# ./home/nixdev.nix
# ];
# };
# };
};
}

View File

@ -0,0 +1,5 @@
{ pkgs, ... }:
{
imports = [
] ;
}

View File

@ -1,6 +1,6 @@
{ inputs, config, ... }:
let
secretsFile = ../../../../secrets.yaml;
secretsFile = ../../../secrets.yaml;
homeDirectory = config.home.homeDirectory;
in
{

16
home/fileserver.nix Normal file
View File

@ -0,0 +1,16 @@
{
pkgs,
config,
lib,
...
}: {
imports = [
./common/core
./common/optional/sops.nix
# Import optional
./common/optional/git.nix
# Import users
./users/admin
];

View File

@ -9,6 +9,12 @@
./common/optional/desktop/hyprland
./common/optional/desktop/waybar.nix
./common/optional/sops.nix
# Import optional
./common/optional/git.nix
# Import users
./users/sam
];
# ------

View File

@ -6,7 +6,6 @@
home.stateVersion = "23.11";
imports = [
./git.nix
] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules?
home.packages = [