making it work

This commit is contained in:
Ivan Kirilov Dimitrov 2024-06-11 19:32:58 +02:00
parent 55e4c663f4
commit 472817d1da
No known key found for this signature in database
GPG Key ID: 0BDAD4B211C49294
3 changed files with 25 additions and 18 deletions

View File

@ -1,5 +1,7 @@
{ ... }: { { ... }: {
imports = [ ./nixos ]; imports = [ ./nixos ];
systems = [ "x86_64-linux" ]; systems = [ "x86_64-linux" ];
perSystem = { system, ... }: { }; perSystem = { inputs, system, ... }: {
_module.args.pkgs = import inputs.nixpkgs { inherit system; };
};
} }

View File

@ -1,5 +1,4 @@
{ inputs, ... }: { moduleWithSystem, ... }: {
let pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; in {
flake.nixosModules = { flake.nixosModules = {
wireguard = { wireguard = {
networking.wg-quick.interfaces = { networking.wg-quick.interfaces = {
@ -43,7 +42,7 @@ let pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; in {
kernelModules = [ "v4l2loopback" ]; kernelModules = [ "v4l2loopback" ];
}; };
}; };
security = { security = moduleWithSystem (toplevel@{ ... }: nixos@{ pkgs, ... }: {
security = { security = {
sudo = { sudo = {
enable = false; enable = false;
@ -66,8 +65,7 @@ let pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; in {
rtkit.enable = true; rtkit.enable = true;
pam = { services = { swaylock = { }; }; }; pam = { services = { swaylock = { }; }; };
}; };
});
};
xdg = { xdg = {
xdg = { xdg = {
portal = { portal = {
@ -118,7 +116,7 @@ let pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; in {
}; };
}; };
}; };
users = { users = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
users = { users = {
defaultUserShell = pkgs.zsh; defaultUserShell = pkgs.zsh;
users = { users = {
@ -141,7 +139,7 @@ let pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; in {
}; };
extraGroups = { mlocate = { }; }; extraGroups = { mlocate = { }; };
}; };
}; });
services = { services = {
services = { services = {
xserver.videoDrivers = [ "nouveau" ]; xserver.videoDrivers = [ "nouveau" ];
@ -162,7 +160,7 @@ let pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; in {
dconf.enable = true; dconf.enable = true;
}; };
}; };
env = { env = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
cmatrix cmatrix
@ -186,8 +184,8 @@ let pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; in {
]; ];
shells = with pkgs; [ zsh nushell ]; shells = with pkgs; [ zsh nushell ];
}; };
}; });
rest = { rest = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
nix = { nix = {
extraOptions = '' extraOptions = ''
experimental-features = nix-command flakes experimental-features = nix-command flakes
@ -202,6 +200,6 @@ let pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; in {
i18n.supportedLocales = [ "all" ]; i18n.supportedLocales = [ "all" ];
time.timeZone = "Europe/Prague"; time.timeZone = "Europe/Prague";
fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) noto-fonts noto-fonts-emoji noto-fonts-lgc-plus ]; fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) noto-fonts noto-fonts-emoji noto-fonts-lgc-plus ];
}; });
}; };
} }

View File

@ -1,11 +1,18 @@
{ inputs, config, ... }: { toplevel@{ inputs, withSystem, ... }:
flake.nixosConfigurations = { let
nixos = inputs.nixpkgs.lib.nixosSystem { system = "x86_64-linux";
in
{
flake.nixosConfigurations.nixos = withSystem system (ctx@{ config, inputs', ... }:
inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs inputs';
packages = config.packages;
};
modules = [ modules = [
./laptop-hardware.nix ./laptop-hardware.nix
inputs.hosts.nixosModule inputs.hosts.nixosModule
inputs.catppuccin.nixosModules.catppuccin inputs.catppuccin.nixosModules.catppuccin
] ++ (with config.flake.nixosModules; [ wireguard catppuccin boot security xdg networking users services programs env rest ]); ] ++ (with toplevel.config.flake.nixosModules; [ wireguard catppuccin boot security xdg networking users services programs env rest ]);
}; });
};
} }