Skip to content

Commit

Permalink
Refactor flake entry file
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigmanificient committed Dec 21, 2023
1 parent fcfc5f3 commit 2dd5b41
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 79 deletions.
21 changes: 0 additions & 21 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

105 changes: 47 additions & 58 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,81 +4,70 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";

ecsls.url = "github:Sigmapitech-meta/ecsls";
hosts.url = "github:StevenBlack/hosts";
nixos-hardware.url = "github:NixOS/nixos-hardware";

nix-index-database.url = "github:Mic92/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";

ecsls.url = "github:Sigmapitech-meta/ecsls";

home-manager = {
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs =
{ nixpkgs
, nix-index-database
, nixos-hardware
, home-manager
, hosts
, ecsls
, ...
}:
let
username = "sigmanificient";
outputs = inputs:
with inputs; let
system = "x86_64-linux";

pkgs = nixpkgs.legacyPackages.${system};

default_modules = [
./config

nix-index-database.nixosModules.nix-index

home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${username} = import ./home;
extraSpecialArgs = {
inherit username system ecsls;
};
};
}

hosts.nixosModule
{
networking.stevenBlackHosts.enable = true;
}
];

in
{
formatter.${system} = pkgs.nixpkgs-fmt;

nixosConfigurations = {
Bacon = nixpkgs.lib.nixosSystem {
inherit system;

specialArgs = {
inherit username;
hostname = "Bacon";
};
nixosConfigurations =
let
username = "sigmanificient";
in
{
Bacon = nixpkgs.lib.nixosSystem {
inherit system;

modules = default_modules ++ [
./hardware-configuration.nix
./config/bacon.nix
specialArgs = {
inherit username;
hostname = "Bacon";
};

nixos-hardware.nixosModules.asus-battery
nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-pc
nixos-hardware.nixosModules.common-pc-ssd
];
modules =
let
mod-home-mananger = home-manager.nixosModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${username} = import ./home;
extraSpecialArgs = {
inherit username system ecsls;
};
};
};

mod-hosts = hosts.nixosModule {
networking.stevenBlackHosts.enable = true;
};

mod-nixhardware-lst = with nixos-hardware.nixosModules; [
asus-battery
common-cpu-amd
common-pc
common-pc-ssd
];
in
[
./config
./hardware-configuration.nix
./config/bacon.nix
mod-home-mananger
mod-hosts
]
++ mod-nixhardware-lst;
};
};
};
};
}

0 comments on commit 2dd5b41

Please sign in to comment.