Compare commits

...

2 Commits

Author SHA1 Message Date
5edd8b1e01
Migrated from import based to config based 2024-12-23 17:03:36 +01:00
c1b12746f5
Cosmic updates 2024-12-21 20:09:35 +01:00
36 changed files with 530 additions and 344 deletions

42
flake.lock generated
View File

@ -39,11 +39,11 @@
]
},
"locked": {
"lastModified": 1733572789,
"narHash": "sha256-zjO6m5BqxXIyjrnUziAzk4+T4VleqjstNudSqWcpsHI=",
"lastModified": 1734366194,
"narHash": "sha256-vykpJ1xsdkv0j8WOVXrRFHUAdp9NXHpxdnn1F4pYgSw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c7ffc9727d115e433fd884a62dc164b587ff651d",
"rev": "80b0fdf483c5d1cb75aaad909bd390d48673857f",
"type": "github"
},
"original": {
@ -80,11 +80,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1733708804,
"narHash": "sha256-PiUrztTiR4aVRC2fMdNcOWYWF1ojvqbrSUYmhtp3970=",
"lastModified": 1734745015,
"narHash": "sha256-HGl0yR/qfGTO99NfiB5bqTe2nPKmD57opzB/TwhJSW0=",
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"rev": "1531210f371ecf966ff67e87975f684553bdbbf7",
"rev": "1c922245aec471610533c7a225bf9c20e7002ff2",
"type": "github"
},
"original": {
@ -95,11 +95,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1733481457,
"narHash": "sha256-IS3bxa4N1VMSh3/P6vhEAHQZecQ3oAlKCDvzCQSO5Is=",
"lastModified": 1734352517,
"narHash": "sha256-mfv+J/vO4nqmIOlq8Y1rRW8hVsGH3M+I2ESMjhuebDs=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "e563803af3526852b6b1d77107a81908c66a9fcf",
"rev": "b12e314726a4226298fe82776b4baeaa7bcf3dcd",
"type": "github"
},
"original": {
@ -111,11 +111,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1733581040,
"narHash": "sha256-Qn3nPMSopRQJgmvHzVqPcE3I03zJyl8cSbgnnltfFDY=",
"lastModified": 1734424634,
"narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "22c3f2cf41a0e70184334a958e6b124fb0ce3e01",
"rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33",
"type": "github"
},
"original": {
@ -142,11 +142,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1733412085,
"narHash": "sha256-FillH0qdWDt/nlO6ED7h4cmN+G9uXwGjwmCnHs0QVYM=",
"lastModified": 1734600368,
"narHash": "sha256-nbG9TijTMcfr+au7ZVbKpAhMJzzE2nQBYmRvSdXUD8g=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4dc2fc4e62dbf62b84132fe526356fbac7b03541",
"rev": "b47fd6fa00c6afca88b8ee46cfdb00e104f50bca",
"type": "github"
},
"original": {
@ -158,11 +158,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1733581040,
"narHash": "sha256-Qn3nPMSopRQJgmvHzVqPcE3I03zJyl8cSbgnnltfFDY=",
"lastModified": 1734424634,
"narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "22c3f2cf41a0e70184334a958e6b124fb0ce3e01",
"rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33",
"type": "github"
},
"original": {
@ -192,11 +192,11 @@
]
},
"locked": {
"lastModified": 1733625333,
"narHash": "sha256-tIML2axjm4AnlKP29upVJxzBpj4Cy4ak+PKonqQtXmc=",
"lastModified": 1734661750,
"narHash": "sha256-BI58NBdimxu1lnpOrG9XxBz7Cwqy+qIf99zunWofX5w=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "430c8b054e45ea44fd2c9521a378306ada507a6c",
"rev": "7d3d910d5fd575e6e8c5600d83d54e5c47273bfe",
"type": "github"
},
"original": {

View File

@ -2,30 +2,39 @@
{
imports = [
# Import hardware configuration
./hardware-configuration.nix
# GUI
../../modules/system/gui/hyprland.nix
../../modules/system/gui/steam.nix
../../modules/system/gui/thunar.nix
# ../../modules/system/gui/plasma.nix
# CLI
../../modules/system/cli/common.nix
../../modules/system/cli/docker.nix
# Hardware
# ../../modules/system/hardware/amd.nix
../../modules/system/hardware/bluetooth.nix
../../modules/system/hardware/firewall.nix
../../modules/system/hardware/garbage-collection.nix
../../modules/system/hardware/laptop.nix
../../modules/system/hardware/locale.nix
../../modules/system/hardware/printing.nix
../../modules/system/hardware/fprint.nix
../../modules/system/hardware/virt.nix
# Import modules
../../modules/system/default.nix
];
settings = {
display-manager = "cosmic-greeter";
desktop-environments = {
cosmic.enable = true;
hyprland.enable = true;
};
applications = {
common.enable = true;
steam.enable = true;
thunar.enable = true;
};
services = {
docker.enable = true;
quickemu.enable = true;
sunshine.enable = false;
garbage-collection.enable = true;
};
hardware = {
fprint.enable = true;
printing.enable = true;
bluetooth.enable = true;
firewall.enable = true;
locale.enable = true;
};
};
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
@ -40,6 +49,7 @@
};
# Configure hardware
services.ratbagd.enable = true;
# Bootloader.
boot.loader.efi.canTouchEfiVariables = true;
@ -60,10 +70,6 @@
nix.settings.trusted-users = [ "root" "xeovalyte" ];
# Enable cosmic desktop eenvironment
services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = true;
# Prevent system freeze on high load
services.earlyoom = {
enable = true;

View File

@ -46,10 +46,8 @@
# Desktop Applications
kdenlive
prismlauncher
unstable.modrinth-app
unstable.joplin-desktop
unstable.prusa-slicer
unstable.font-manager
signal-desktop
unstable.vesktop
unstable.webcord
@ -58,7 +56,6 @@
loupe
unstable.rnote
unstable.bottles
resources
# Office
libreoffice
@ -78,15 +75,6 @@
# Enable home-manager
programs.home-manager.enable = true;
# Enable default applications
xdg.mimeApps = {
enable = true;
defaultApplications = {
"application/pdf" = "firefox.desktop";
"application/rnote" = "rnote.desktop";
};
};
home.stateVersion = "24.05";
};

View File

@ -23,11 +23,11 @@
keybinds {
normal {
bind "Ctrl e" { ToggleFloatingPanes; SwitchToMode "normal"; }
bind "Ctrl 1" { GoToTab 1; }
bind "Ctrl 2" { GoToTab 2; }
bind "Ctrl 3" { GoToTab 3; }
bind "Ctrl 4" { GoToTab 4; }
bind "Ctrl 5" { GoToTab 5; }
bind "Alt 1" { GoToTab 1; }
bind "Alt 2" { GoToTab 2; }
bind "Alt 3" { GoToTab 3; }
bind "Alt 4" { GoToTab 4; }
bind "Alt 5" { GoToTab 5; }
}
}
'';

View File

@ -0,0 +1,34 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.settings.applications.common;
in {
options = {
settings.applications.common.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable common applications
'';
};
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
usbutils
tree
fastfetch
btop
git
yazi
just
];
environment.pathsToLink = [ "/share/zsh" ];
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
};
}

View File

@ -0,0 +1,31 @@
{ config, lib, ... }:
with lib;
let
cfg = config.settings.applications.steam;
in {
options = {
settings.applications.steam.enable = lib.mkOption {
type = with lib.types; bool;
description = ''
Enable steam
'';
};
};
config = mkIf cfg.enable {
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"steam"
"steam-original"
"steam-run"
];
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
};
}

View File

@ -0,0 +1,30 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.settings.applications.thunar;
in {
options = {
settings.applications.thunar.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable thunar file manager
'';
};
};
config = mkIf cfg.enable {
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
services.gvfs.enable = true;
services.tumbler.enable = true;
programs.file-roller.enable = true;
};
}

View File

@ -1,19 +0,0 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
usbutils
tree
fastfetch
btop
git
yazi
just
];
environment.pathsToLink = [ "/share/zsh" ];
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
}

View File

@ -1,22 +0,0 @@
{ pkgs, ... }:
{
virtualisation.docker = {
enable = true;
rootless = {
enable = true;
setSocketVariable = true;
};
};
users.users.xeovalyte.extraGroups = [ "docker" ];
security.wrappers = {
docker-rootlesskit = {
owner = "root";
group = "root";
capabilities = "cap_net_bind_service+ep";
source = "${pkgs.rootlesskit}/bin/rootlesskit";
};
};
}

View File

@ -1,19 +0,0 @@
{ pkgs, ... }:
{
virtualisation.containers.enable = true;
virtualisation.podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
virtualisation.oci-containers.backend = "podman";
environment.systemPackages = with pkgs; [
dive
podman-tui
podman-compose
];
}

View File

@ -0,0 +1,26 @@
{ ... }:
{
imports = [
./applications/common.nix
./applications/steam.nix
./applications/thunar.nix
./services/docker.nix
./services/quickemu.nix
./services/sunshine.nix
./services/garbage-collection.nix
./hardware/bluetooth.nix
./hardware/fprint.nix
./hardware/locale.nix
# ./hardware/nvidia.nix
./hardware/firewall.nix
./hardware/printing.nix
./desktop-environments/cosmic.nix
./desktop-environments/hyprland.nix
./display-managers/default.nix
];
}

View File

@ -0,0 +1,24 @@
{ lib, config, ... }:
with lib;
let
cfg = config.settings.desktop-environments.cosmic;
in {
options = {
settings.desktop-environments.cosmic.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable cosmic desktop environment
'';
};
};
config = mkIf cfg.enable {
services.desktopManager.cosmic.enable = true;
environment.sessionVariables = {
COSMIC_DISABLE_DIRECT_SCANOUT = "true";
};
};
}

View File

@ -0,0 +1,44 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.settings.desktop-environments.hyprland;
in {
options = {
settings.desktop-environments.hyprland.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable hyprland window manager
'';
};
};
config = mkIf cfg.enable {
programs.hyprland = {
enable = true;
package = pkgs.unstable.hyprland;
xwayland.enable = true;
};
# Sound configuration
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Keyring configuration
security.polkit.enable = true;
services.gnome.gnome-keyring.enable = true;
security.pam.services.greetd.enableGnomeKeyring = true;
programs.ssh.startAgent = true;
# Configure networking
networking.networkmanager.enable = true;
networking.wireless.iwd.enable = true;
};
}

View File

@ -0,0 +1,11 @@
{ lib, config, ... }:
with lib;
let
cfg = config.settings.display-manager;
in {
config = mkIf (cfg == "cosmic-greeter") {
services.displayManager.cosmic-greeter.enable = true;
};
}

View File

@ -0,0 +1,21 @@
{ lib, ... }:
with lib;
let
cfg = config.settings.display-manager;
in {
options = {
settings.display-manager = lib.mkOption {
type = lib.types.enum ["sddm" "cosmic-greeter"];
description = ''
Specify which display manager to use
'';
};
};
imports = [
./sddm.nix
./cosmic-greeter.nix
];
}

View File

@ -0,0 +1,20 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.settings.display-manager;
in {
config = mkIf (cfg == "sddm") {
environment.systemPackages = with pkgs; [
libsForQt5.qt5.qtquickcontrols2
libsForQt5.qt5.qtgraphicaleffects
];
services.displayManager.sddm = {
enable = true;
wayland.enable = true;
theme = "${import ./sddm-theme.nix { inherit pkgs; }}";
};
};
}

View File

@ -1,52 +0,0 @@
{ config, pkgs, ... }:
{
programs.hyprland = {
enable = true;
package = pkgs.unstable.hyprland;
xwayland.enable = true;
};
# Configure display manager
# services.greetd = {
# enable = true;
# settings = {
# default_session = {
# command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --time --cmd Hyprland";
# user = "xeovalyte";
# };
# };
# };
# SDDM configuration
# environment.systemPackages = with pkgs; [
# libsForQt5.qt5.qtquickcontrols2
# libsForQt5.qt5.qtgraphicaleffects
# ];
# services.displayManager.sddm = {
# enable = true;
# wayland.enable = true;
# theme = "${import ./sddm-theme.nix { inherit pkgs; }}";
# };
# Sound configuration
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Keyring configuration
security.polkit.enable = true;
services.gnome.gnome-keyring.enable = true;
security.pam.services.greetd.enableGnomeKeyring = true;
programs.ssh.startAgent = true;
# Configure networking
networking.networkmanager.enable = true;
networking.wireless.iwd.enable = true;
}

View File

@ -1,5 +0,0 @@
{ ... }:
{
programs.noisetorch.enable = true;
}

View File

@ -1,18 +0,0 @@
{ pkgs, ... }:
{
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
}

View File

@ -1,16 +0,0 @@
{ config, lib, nixpkgs, ... }:
{
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"steam"
"steam-original"
"steam-run"
];
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
}

View File

@ -1,11 +0,0 @@
{ pkgs, ... }:
{
services.sunshine = {
enable = true;
package = pkgs.unstable.sunshine.override { cudaSupport = true; };
autoStart = true;
capSysAdmin = true;
openFirewall = true;
};
}

View File

@ -1,15 +0,0 @@
{ pkgs, ... }:
{
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
services.gvfs.enable = true;
services.tumbler.enable = true;
programs.file-roller.enable = true;
}

View File

@ -1,16 +0,0 @@
{ pkgs, ... }:
{
hardware.graphics = {
enable = true;
enable32Bit = true;
};
hardware.graphics.extraPackages = with pkgs; [
amdvlk
];
hardware.graphics.extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
}

View File

@ -1,6 +1,20 @@
{ pkgs, ... }:
{ config, lib, ... }:
{
with lib;
let
cfg = config.settings.hardware.bluetooth;
in {
options = {
settings.hardware.bluetooth.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable bluetooth
'';
};
};
config = mkIf cfg.enable {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
@ -12,4 +26,5 @@
};
services.blueman.enable = true;
};
}

View File

@ -1,9 +1,24 @@
{ ... }:
{ config, lib, ... }:
{
with lib;
let
cfg = config.settings.hardware.firewall;
in {
options = {
settings.hardware.firewall.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable firewall
'';
};
};
config = mkIf cfg.enable {
networking.firewall = {
enable = true;
allowedTCPPorts = [ ];
allowedUDPPorts = [ ];
};
};
}

View File

@ -1,8 +1,23 @@
{ lib, pkgs, ... }:
{ config, lib, ... }:
{
with lib;
let
cfg = config.settings.hardware.fprint;
in {
options = {
settings.hardware.fprint.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable fingerprint
'';
};
};
config = mkIf cfg.enable {
services.fprintd.enable = true;
security.pam.services.login.fprintAuth = false;
security.pam.services.cosmic-greeter.fprintAuth = false;
};
}

View File

@ -1,11 +0,0 @@
{ ... }:
{
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 1w";
};
nix.settings.auto-optimise-store = true;
}

View File

@ -1,24 +0,0 @@
{ ... }:
{
# services.auto-cpufreq.enable = true;
# services.auto-cpufreq.settings = {
# battery = {
# governor = "powersave";
# turbo = "never";
# };
# charger = {
# governor = "performance";
# turbo = "auto";
# };
# };
services.power-profiles-daemon.enable = true;
boot.extraModprobeConfig = ''
options snd_hda_intel power_save=0
'';
# powerManagement.powertop.enable = true;
}

View File

@ -1,6 +1,20 @@
{ ... }:
{ config, lib, ... }:
{
with lib;
let
cfg = config.settings.hardware.locale;
in {
options = {
settings.hardware.locale.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable locale configuration
'';
};
};
config = mkIf cfg.enable {
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
@ -18,4 +32,5 @@
LC_TELEPHONE = "nl_NL.UTF-8";
LC_TIME = "nl_NL.UTF-8";
};
};
}

View File

@ -1,8 +1,23 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
{
with lib;
let
cfg = config.settings.hardware.printing;
in {
options = {
settings.hardware.printing.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable printer configuration
'';
};
};
config = mkIf cfg.enable {
services.printing = {
enable = true;
drivers = [ pkgs.hplip ];
};
};
}

View File

@ -1,12 +0,0 @@
{ pkgs, ... }:
{
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
users.users.xeovalyte.extraGroups = [ "libvirtd" ];
environment.systemPackages = with pkgs; [
quickemu
];
}

View File

@ -0,0 +1,37 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.settings.services.docker;
in {
options = {
settings.services.docker.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable docker configuration
'';
};
};
config = mkIf cfg.enable {
virtualisation.docker = {
enable = true;
rootless = {
enable = true;
setSocketVariable = true;
};
};
users.users.xeovalyte.extraGroups = [ "docker" ];
security.wrappers = {
docker-rootlesskit = {
owner = "root";
group = "root";
capabilities = "cap_net_bind_service+ep";
source = "${pkgs.rootlesskit}/bin/rootlesskit";
};
};
};
}

View File

@ -0,0 +1,26 @@
{ config, lib, ... }:
with lib;
let
cfg = config.settings.services.garbage-collection;
in {
options = {
settings.services.garbage-collection.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable garbage collection of nix store
'';
};
};
config = mkIf cfg.enable {
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 1w";
};
nix.settings.auto-optimise-store = true;
};
}

View File

@ -0,0 +1,27 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.settings.services.quickemu;
in {
options = {
settings.services.quickemu.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable quickemu virtualisation
'';
};
};
config = mkIf cfg.enable {
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
users.users.xeovalyte.extraGroups = [ "libvirtd" ];
environment.systemPackages = with pkgs; [
quickemu
];
};
}

View File

@ -0,0 +1,26 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.settings.services.sunshine;
in {
options = {
settings.services.sunshine.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable sunshine service
'';
};
};
config = mkIf cfg.enable {
services.sunshine = {
enable = true;
package = pkgs.unstable.sunshine.override { cudaSupport = true; };
autoStart = true;
capSysAdmin = true;
openFirewall = true;
};
};
}