refactor part 2

This commit is contained in:
Gustav Bruhn 2025-08-24 20:39:46 +02:00
parent 1bd4a22c68
commit 32dc0f6994
5 changed files with 34 additions and 125 deletions

View File

@ -8,6 +8,7 @@
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/nixos/common.nix ../../modules/nixos/common.nix
../../modules/options.nix
]; ];
# Bootloader. # Bootloader.
boot.loader = { boot.loader = {
@ -26,13 +27,16 @@
}; };
}; };
myOptions.niri.enable = true;
networking.hostName = "desktop"; # Define your hostname. networking.hostName = "desktop"; # Define your hostname.
home-manager = { home-manager = {
extraSpecialArgs = {inherit inputs;}; extraSpecialArgs = {
users = { inherit inputs pkgs;
"bruhng" = import ./home.nix; myOptions = config.myOptions;
}; };
users."bruhng" = import ./home.nix;
}; };
system.stateVersion = "25.05"; # Do not channge system.stateVersion = "25.05"; # Do not channge

View File

@ -1,11 +1,12 @@
{ {
config, myOptions,
pkgs, pkgs,
... ...
}: { }: {
imports = [ imports = [
../../modules/home-manager/helix.nix ../../modules/home-manager/helix.nix
../../modules/home-manager/zsh.nix ../../modules/home-manager/zsh.nix
../../modules/home-manager/niri.nix
]; ];
home.username = "bruhng"; home.username = "bruhng";
home.homeDirectory = "/home/bruhng"; home.homeDirectory = "/home/bruhng";

View File

@ -7,103 +7,16 @@
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
inputs.home-manager.nixosModules.default
../../modules/options.nix ../../modules/options.nix
../../modules/nixos/common.nix
]; ];
specialisation = {
cosmic = {
inheritParentConfig = true;
configuration = {
imports = [
../../modules/nixos/cosmic.nix
];
environment.etc."active-specialisation".text = "cosmic";
};
};
wm = {
inheritParentConfig = true;
configuration = {
services.displayManager.ly = {
x11Support = false;
enable = true;
};
myOptions.niri.enable = true;
environment.etc."active-specialisation".text = "wm";
programs.niri.enable = true;
environment.systemPackages = with pkgs; [
ghostty
fuzzel
];
services.gnome.gnome-keyring.enable = true;
security.pam.services.swaylock = {};
};
};
};
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "framework"; # Define your hostname. networking.hostName = "framework"; # Define your hostname.
nix.settings.experimental-features = ["nix-command" "flakes"];
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Stockholm";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "sv_SE.UTF-8";
LC_IDENTIFICATION = "sv_SE.UTF-8";
LC_MEASUREMENT = "sv_SE.UTF-8";
LC_MONETARY = "sv_SE.UTF-8";
LC_NAME = "sv_SE.UTF-8";
LC_NUMERIC = "sv_SE.UTF-8";
LC_PAPER = "sv_SE.UTF-8";
LC_TELEPHONE = "sv_SE.UTF-8";
LC_TIME = "sv_SE.UTF-8";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "se";
variant = "";
};
# Configure console keymap
console.keyMap = "sv-latin1";
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Define a user account. Don't forget to set a password with passwd.
users.users.bruhng = {
isNormalUser = true;
description = "Gustav Bruhn";
extraGroups = ["networkmanager" "wheel" "wireshark"];
};
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
home-manager = { home-manager = {
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs pkgs; inherit inputs pkgs;
@ -112,31 +25,5 @@
users."bruhng" = import ./home.nix; users."bruhng" = import ./home.nix;
}; };
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
nil
discord
alejandra
inputs.zen-browser.packages.${pkgs.system}.default
tmux
fastfetch
spotify
evince
loupe
];
programs.steam.enable = true;
# List services that you want to enable:
services.fwupd.enable = true;
security.polkit.enable = true;
# fonts
fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono
];
system.stateVersion = "25.05"; # Do not channge system.stateVersion = "25.05"; # Do not channge
} }

View File

@ -1,4 +1,3 @@
{ {
config, config,
pkgs, pkgs,
@ -7,10 +6,10 @@
}: { }: {
imports = [ imports = [
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
../../modules/nixos/cosmic.nix # ../../modules/nixos/cosmic.nix
./niri.nix
]; ];
nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings.experimental-features = ["nix-command" "flakes"];
# Enable networking # Enable networking
@ -66,7 +65,6 @@
programs.zsh.enable = true; programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh; users.defaultUserShell = pkgs.zsh;
# Allow unfree packages # Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@ -83,7 +81,6 @@
loupe loupe
]; ];
programs.steam.enable = true; programs.steam.enable = true;
# List services that you want to enable: # List services that you want to enable:
@ -94,5 +91,4 @@
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono nerd-fonts.jetbrains-mono
]; ];
} }

21
modules/nixos/niri.nix Normal file
View File

@ -0,0 +1,21 @@
{
myOptions,
pkgs,
lib,
...
}:
lib.mkIf myOptions.niri.enable
{
services.displayManager.ly = {
x11Support = false;
enable = true;
};
programs.niri.enable = true;
environment.systemPackages = with pkgs; [
ghostty
fuzzel
];
services.gnome.gnome-keyring.enable = true;
security.pam.services.swaylock = {};
}