refactor(wip): make common a bit better

This commit is contained in:
matt1432 2023-12-01 03:07:17 -05:00
parent cab24db17b
commit 3184379170
10 changed files with 80 additions and 79 deletions

View file

@ -1,10 +1,7 @@
{
config,
home-manager,
lib,
nixpkgs,
nixpkgs-wayland,
nix-index-database,
nh,
nur,
nix-melt,
@ -13,15 +10,13 @@
...
}: {
imports = [
./cachix.nix
./overlays
./device-vars.nix
home-manager.nixosModules.default
nh.nixosModules.default
./modules
./overlays
./modules/locale.nix
./modules/locate.nix
nur.nixosModules.nur
nh.nixosModules.default
];
nixpkgs.config.allowUnfree = true;
@ -42,9 +37,6 @@
exact = false;
};
};
nixpkgs.overlays = [
nixpkgs-wayland.overlay
];
nh = {
enable = true;
@ -67,24 +59,13 @@
};
home-manager.users = let
user = config.services.device-vars.username;
default = {
imports = [
nur.hmModules.nur
nix-index-database.hmModules.nix-index
{
programs = {
nix-index-database.comma.enable = true;
nix-index = {
enable = true;
enableBashIntegration = true;
};
};
}
./home/bash
./home/git.nix
./home/neovim
./home/tmux.nix
./home
./device-vars.nix
({osConfig, ...}: {
@ -115,11 +96,11 @@
imagemagick
usbutils
]);
home.stateVersion = lib.mkDefault "23.05";
};
in {
root = default;
matt = default;
# TODO: make user an array?
${user} = default;
};
}

9
common/home/default.nix Normal file
View file

@ -0,0 +1,9 @@
{
imports = [
./bash
./git
./neovim
./nix-index
./tmux
];
}

View file

@ -0,0 +1,11 @@
{nix-index-db, ...}: {
imports = [nix-index-db.hmModules.nix-index];
programs = {
nix-index-database.comma.enable = true;
nix-index = {
enable = true;
enableBashIntegration = true;
};
};
}

View file

@ -0,0 +1,7 @@
{
imports = [
./cachix.nix
./locale.nix
./locate.nix
];
}

View file

@ -1,4 +1,4 @@
{neovim-flake, ...}: {
{neovim-flake, nixpkgs-wayland, ...}: {
imports = [
./dracula-theme.nix
./regreet.nix
@ -7,7 +7,9 @@
nixpkgs.overlays = [
(import ./blueberry.nix)
(import ./squeekboard.nix)
neovim-flake.overlay
nixpkgs-wayland.overlay
(final: prev: {
spotifywm = final.callPackage ./pkgs/spotifywm.nix {};

View file

@ -543,7 +543,7 @@
"type": "github"
}
},
"nix-index-database": {
"nix-index-db": {
"inputs": {
"nixpkgs": [
"nixpkgs"
@ -792,7 +792,7 @@
"neovim-flake": "neovim-flake",
"nh": "nh",
"nix-gaming": "nix-gaming",
"nix-index-database": "nix-index-database",
"nix-index-db": "nix-index-db",
"nix-melt": "nix-melt",
"nixpkgs": "nixpkgs_4",
"nixpkgs-wayland": "nixpkgs-wayland",

View file

@ -1,4 +1,42 @@
{
outputs = {
self,
home-manager,
nixpkgs,
...
} @ attrs: let
defaultModules = [
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = attrs;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
./common
];
in {
nixosConfigurations = {
wim = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules =
defaultModules
++ [./devices/wim];
};
binto = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules =
defaultModules
++ [./devices/binto];
};
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
formatter.aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.alejandra;
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
@ -53,56 +91,9 @@
nix-melt.url = "github:nix-community/nix-melt";
nurl.url = "github:nix-community/nurl";
nix-index-database = {
nix-index-db = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
home-manager,
nix-gaming,
nixpkgs,
nur,
...
} @ attrs: let
defaultModules = [
nur.nixosModules.nur
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = attrs;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
./common/default.nix
];
in {
nixosConfigurations = {
wim = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules =
defaultModules
++ [
./devices/wim
];
};
binto = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules =
defaultModules
++ [
./devices/binto
];
};
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
formatter.aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.alejandra;
};
}