Compare commits

...

3 Commits

Author SHA1 Message Date
ce228bf80b refactor done 2025-08-24 20:56:23 +02:00
32dc0f6994 refactor part 2 2025-08-24 20:39:46 +02:00
1bd4a22c68 refactor 2025-08-24 20:24:36 +02:00
7 changed files with 135 additions and 212 deletions

18
flake.lock generated
View File

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1754886238,
"narHash": "sha256-LTQomWOwG70lZR+78ZYSZ9sYELWNq3HJ7/tdHzfif/s=",
"lastModified": 1756022458,
"narHash": "sha256-J1i35r4HfNDdPpwL0vOBaZopQudAUVtartEerc1Jryc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "0d492b89d1993579e63b9dbdaed17fd7824834da",
"rev": "9e3a33c0bcbc25619e540b9dfea372282f8a9740",
"type": "github"
},
"original": {
@ -22,11 +22,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1754564048,
"narHash": "sha256-dz303vGuzWjzOPOaYkS9xSW+B93PSAJxvBd6CambXVA=",
"lastModified": 1755330281,
"narHash": "sha256-aJHFJWP9AuI8jUGzI77LYcSlkA9wJnOIg4ZqftwNGXA=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "26ed7a0d4b8741fe1ef1ee6fa64453ca056ce113",
"rev": "3dac8a872557e0ca8c083cdcfc2f218d18e113b0",
"type": "github"
},
"original": {
@ -38,11 +38,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1754725699,
"narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=",
"lastModified": 1755615617,
"narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054",
"rev": "20075955deac2583bb12f07151c2df830ef346b4",
"type": "github"
},
"original": {

View File

@ -7,8 +7,8 @@
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
inputs.home-manager.nixosModules.default
../../modules/nixos/cosmic.nix
../../modules/nixos/common.nix
../../modules/options.nix
];
# Bootloader.
boot.loader = {
@ -27,96 +27,17 @@
};
};
myOptions.niri.enable = false;
networking.hostName = "desktop"; # 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"];
};
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
home-manager = {
extraSpecialArgs = {inherit inputs;};
users = {
"bruhng" = import ./home.nix;
extraSpecialArgs = {
inherit inputs pkgs;
myOptions = config.myOptions;
};
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
nmap
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
}

View File

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

View File

@ -7,103 +7,16 @@
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
inputs.home-manager.nixosModules.default
../../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.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
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 = {
extraSpecialArgs = {
inherit inputs pkgs;
@ -112,31 +25,5 @@
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
}

94
modules/nixos/common.nix Normal file
View File

@ -0,0 +1,94 @@
{
config,
pkgs,
inputs,
...
}: {
imports = [
inputs.home-manager.nixosModules.default
../../modules/nixos/cosmic.nix
./niri.nix
];
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"];
};
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
nil
discord
alejandra
inputs.zen-browser.packages.${pkgs.system}.default
tmux
fastfetch
nmap
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
];
}

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

@ -0,0 +1,20 @@
{
config,
pkgs,
lib,
...
}:
lib.mkIf config.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 = {};
}

View File

@ -20,7 +20,7 @@ fi
git add .
echo "New changes, Rebuilding..."
sudo nixos-rebuild switch --upgrade --flake . --specialisation $(cat /etc/active-specialisation)
sudo nixos-rebuild switch --upgrade --flake .
current=$(nixos-rebuild list-generations | grep current)