diff --git a/.gitignore b/.gitignore index 589556f..511d463 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -### Jetbrains -/.idea \ No newline at end of file +# Jetbrains configuration directory +/.idea diff --git a/.idea/nix-config.iml b/.idea/nix-config.iml index d6da34e..c956989 100644 --- a/.idea/nix-config.iml +++ b/.idea/nix-config.iml @@ -1,9 +1,7 @@ - - - + diff --git a/README.md b/README.md index e606761..5951198 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # nix-config -Jo's absolutely insane NixOS configuration - as of july 2024 +Jo's absolutely insane NixOS configuration - not in the good way ## Deployment diff --git a/flake.lock b/flake.lock index 0fdd318..70195ae 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "catppuccin": { "locked": { - "lastModified": 1720472194, - "narHash": "sha256-CYscFEts6tyvosc1T29nxhzIYJAj/1CCEkV3ZMzSN/c=", + "lastModified": 1719915848, + "narHash": "sha256-zq+CMkdT8A9z74HonwspXp8HsX4OvP4uaVdD98AO6as=", "owner": "catppuccin", "repo": "nix", - "rev": "d75d5803852fb0833767dc969a4581ac13204e22", + "rev": "9345073d27d91ab66c1b6ab65df322906992aa59", "type": "github" }, "original": { @@ -15,66 +15,13 @@ "type": "github" } }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils-plus": { - "inputs": { - "flake-utils": "flake-utils" - }, - "locked": { - "lastModified": 1715533576, - "narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=", - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", - "type": "github" - }, - "original": { - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", - "type": "github" - } - }, "hardware": { "locked": { - "lastModified": 1721413321, - "narHash": "sha256-0GdiQScDceUrVGbxYpV819LHesK3szHOhJ09e6sgES4=", + "lastModified": 1719895800, + "narHash": "sha256-xNbjISJTFailxass4LmdWeV4jNhAlmJPwj46a/GxE6M=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "ab165a8a6cd12781d76fe9cbccb9e975d0fb634f", + "rev": "6e253f12b1009053eff5344be5e835f604bb64cd", "type": "github" }, "original": { @@ -91,15 +38,16 @@ ] }, "locked": { - "lastModified": 1721534365, - "narHash": "sha256-XpZOkaSJKdOsz1wU6JfO59Rx2fqtcarQ0y6ndIOKNpI=", + "lastModified": 1719827439, + "narHash": "sha256-tneHOIv1lEavZ0vQ+rgz67LPNCgOZVByYki3OkSshFU=", "owner": "nix-community", "repo": "home-manager", - "rev": "635563f245309ef5320f80c7ebcb89b2398d2949", + "rev": "59ce796b2563e19821361abbe2067c3bb4143a7d", "type": "github" }, "original": { "owner": "nix-community", + "ref": "master", "repo": "home-manager", "type": "github" } @@ -122,11 +70,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1721562059, - "narHash": "sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8=", + "lastModified": 1719848872, + "narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "68c9ed8bbed9dfce253cc91560bf9043297ef2fe", + "rev": "00d80d13810dbfea8ab4ed1009b09100cca86ba8", "type": "github" }, "original": { @@ -136,6 +84,29 @@ "type": "github" } }, + "plasma-manager": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719875930, + "narHash": "sha256-jQmdWLxRP6BzOxRF8hQEhDD7UKw7UrnYbmaAPOSaXWY=", + "owner": "pjones", + "repo": "plasma-manager", + "rev": "7e062fcd669e261fb06cf54fe0ef2e46c3db8e83", + "type": "github" + }, + "original": { + "owner": "pjones", + "repo": "plasma-manager", + "type": "github" + } + }, "root": { "inputs": { "catppuccin": "catppuccin", @@ -143,44 +114,7 @@ "home-manager": "home-manager", "nix-flatpak": "nix-flatpak", "nixpkgs": "nixpkgs", - "snowfall-lib": "snowfall-lib" - } - }, - "snowfall-lib": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils-plus": "flake-utils-plus", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1719005984, - "narHash": "sha256-mpFl3Jv4fKnn+5znYXG6SsBjfXHJdRG5FEqNSPx0GLA=", - "owner": "snowfallorg", - "repo": "lib", - "rev": "c6238c83de101729c5de3a29586ba166a9a65622", - "type": "github" - }, - "original": { - "owner": "snowfallorg", - "repo": "lib", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" + "plasma-manager": "plasma-manager" } } }, diff --git a/flake.nix b/flake.nix index 4c178b0..c50c3ff 100644 --- a/flake.nix +++ b/flake.nix @@ -2,60 +2,94 @@ description = "Jo's NixOS configuration"; inputs = { - # Nixpkgs instance. + # Nixpkgs nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - # Snowfall lib imposes an opinionated file-structure, which makes things a little easier sometimes. - snowfall-lib = { - url = "github:snowfallorg/lib"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - # Home manager for managing the /home directory. + # Home manager home-manager = { - url = "github:nix-community/home-manager"; + url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; }; - # Hardware specific tweaks and performance optimizations. + # Plasma manager + plasma-manager = { + url = "github:pjones/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + hardware.url = "github:NixOS/nixos-hardware/master"; - # Catppuccin theme nix configuration. catppuccin.url = "github:catppuccin/nix"; - # Declarative management of Flatpak packages. nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1"; }; - outputs = inputs: - inputs.snowfall-lib.mkFlake { - inherit inputs; # Providing flake inputs to Snowfall Lib. - src = ./.; # "src" must point to the root of the flake. + outputs = { self, nixpkgs, home-manager, plasma-manager, hardware, catppuccin, nix-flatpak, ... } @inputs: + let + inherit (self) outputs; - snowfall = { - # "root" can be used, to tell Snowfall Lib where to look for Nix files. - # root = ./nix; + # Supported systems for this flake + systems = [ + "x86_64-linux" + ]; - # Namespace for this flake's packages, library and overlays. - namespace = "puzzlevision"; + # Function that generates an attribute by calling a function you pass to it + # It takes each system as an argument + forAllSystems = nixpkgs.lib.genAttrs systems; + in { + # My custom packagess + packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); - meta = { - name = "jos-nixos-configuration"; # Used in certain places, like documentations. No spaces. - title = "Jo's NixOS configuration"; # Basically just for decorational purposes. - }; + # External resources (wallpapers, icons, dotfiles) + resources = import ./resources; + + # My reusable modules for nixos + nixosModules = import ./modules/nixos; + + # My reusable modules for home-manager + homeManagerModules = import ./modules/home-manager; + + # NixOS configuration entrypoint + # Available through 'nixos-rebuild --flake .#your-hostname' + nixosConfigurations = { + puzzlevision = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs outputs;}; + modules = [ + home-manager.nixosModules.home-manager + ./hosts/puzzlevision/configuration.nix + ]; }; - - channels-config = { - allowUnfree = true; # Allow unfree packages. - }; - - # Apply some home-manager modules globally. - homes.modules = with inputs; [ - nix-flatpak.homeManagerModules.nix-flatpak - ]; - - homes.users."jo@puzzlevision".modules = with inputs; [ - catppuccin.homeManagerModules.catppuccin - ]; }; + + # Standalone home-manager configuration entrypoint + # Available through 'home-manager --flake .#your-username@your-hostname' + homeConfigurations = { + "jo@puzzlevision" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance + extraSpecialArgs = {inherit inputs outputs;}; + modules = [ + ./users/jo/home.nix + nix-flatpak.homeManagerModules.nix-flatpak + catppuccin.homeManagerModules.catppuccin + ]; + }; + + "work@puzzlevision" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance + extraSpecialArgs = {inherit inputs outputs;}; + modules = [ + ./users/work/home.nix + ]; + }; + + "gaming@puzzlevision" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance + extraSpecialArgs = {inherit inputs outputs;}; + modules = [ + ./users/gaming/home.nix + ]; + }; + }; + }; } diff --git a/homes/x86_64-linux/jo@puzzlevision/default.nix b/homes/x86_64-linux/jo@puzzlevision/default.nix deleted file mode 100644 index cd1d750..0000000 --- a/homes/x86_64-linux/jo@puzzlevision/default.nix +++ /dev/null @@ -1,70 +0,0 @@ -{ - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. - lib, - # Instance of `pkgs` with overlays and custom packages applied. - pkgs, - # All flake inputs. - inputs, - - # Additional metadata, provided by Snowfall Lib. - namespace, # The flake namespace, set in flake.nix. If not set, defaults to "internal". - home, # The home architecture for this host (eg. `x86_64-linux`). - target, # The Snowfall Lib target for this home (eg. `x86_64-home`). - format, # A normalized name for the home target (eg. `home`). - virtual, # A boolean to determine whether this home is a virtual target using nixos-generators. - host, # The host name for this home. - - # All other arguments come from the home home. - config, - ... -}: { - imports = [ - ./apps/gnome.nix - ]; - - # Flatpak configuration. - services.flatpak = { - enable = true; - update.auto.enable = true; - uninstallUnmanaged = true; - - packages = [ - "com.jeffser.Alpaca" - ]; - }; - - # Declare user packages. - home.packages = with pkgs; [ - ### General - qflipper - wineWowPackages.waylandFull - vesktop - lunar-client - steam - g4music - - ### Development - avra - avrdude - jetbrains.phpstorm - git - nodejs_22 - bun - kitty - forge-sparks - devenv - - ### Work - teams-for-linux - enpass - - ### Notes & Organisation - obsidian - - ### Backups & Synchronization - celeste - ]; - - home.stateVersion = "24.05"; -} \ No newline at end of file diff --git a/systems/x86_64-linux/puzzlevision/default.nix b/hosts/puzzlevision/configuration.nix similarity index 50% rename from systems/x86_64-linux/puzzlevision/default.nix rename to hosts/puzzlevision/configuration.nix index fe5be12..f591563 100644 --- a/systems/x86_64-linux/puzzlevision/default.nix +++ b/hosts/puzzlevision/configuration.nix @@ -1,32 +1,25 @@ { - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. - lib, - # Instance of `pkgs` with overlays and custom packages applied. - pkgs, - # All flake inputs. inputs, - - # Additional metadata, provided by Snowfall Lib. - namespace, # The flake namespace, set in flake.nix. If not set, defaults to "internal". - system, # The system architecture for this host (eg. `x86_64-linux`). - target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). - format, # A normalized name for the system target (eg. `iso`). - virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. - systems, # An attribute map of your defined hosts. - - # All other arguments come from the system system. + lib, config, + pkgs, + outputs, ... }: { + # You can import other NixOS modules here imports = [ - ./hardware-configuration.nix inputs.hardware.nixosModules.common-pc-laptop inputs.hardware.nixosModules.common-cpu-intel inputs.hardware.nixosModules.common-pc-laptop-ssd + outputs.nixosModules.desktop.gnome + ./hardware-configuration.nix ]; nixpkgs = { + config = { + allowUnfree = true; + }; + overlays = [ (final: prev: { linuxPackages_latest = prev.linuxPackages_latest.extend (lpfinal: lpprev: { @@ -44,17 +37,24 @@ }; nix = { + # This will add each flake input as a registry + # To make nix3 commands consistent with your flake + registry = lib.mapAttrs (_: value: {flake = value;}) inputs; + + # This will additionally add your inputs to the system's legacy channels + # Making legacy nix commands consistent as well, awesome! + nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; + settings = { auto-optimise-store = true; builders-use-substitutes = true; - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = [ "nix-command" "flakes" "repl-flake" ]; keep-derivations = true; keep-outputs = true; max-jobs = "auto"; warn-dirty = false; }; - # Garbage collection configuration. gc = { automatic = true; dates = "daily"; @@ -65,45 +65,44 @@ # Set hostname networking.hostName = "puzzlevision"; - # Enable networking through networkmanager (required for most desktop environments). + # Enable networking networking.networkmanager.enable = true; + + # Install the latest kernel + boot.kernelPackages = pkgs.linuxPackages_latest; - boot = { - # Always run the latest kernel. - kernelPackages = pkgs.linuxPackages_latest; + # Network card driver + boot.extraModulePackages = [ + pkgs.linuxPackages_latest.rtl8821ce + ]; - # Configure additional kernel modules. - extraModulePackages = [ - pkgs.linuxPackages_latest.rtl8821ce # Use custom network-card driver. - ]; + boot.blacklistedKernelModules = [ + "rtw88_8821ce" + ]; - blacklistedKernelModules = [ - "rtw88_8821ce" # Block the default network-card driver. - ]; + # Bootloader. + boot.loader.grub = { + enable = true; + devices = [ "nodev" ]; + efiInstallAsRemovable = true; + efiSupport = true; - # Grub configuration. - loader.grub = { - enable = true; - devices = [ "nodev" ]; - efiInstallAsRemovable = true; - efiSupport = true; - - extraEntries = '' - menuentry "Reboot" { - reboot - } - menuentry "Poweroff" { - halt - } - ''; - }; + extraEntries = '' + menuentry "Reboot" { + reboot + } + menuentry "Poweroff" { + halt + } + ''; }; - # Set timezone. + # Set your time zone. time.timeZone = "Europe/Berlin"; - # Internationalisation properties. + # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { LC_ADDRESS = "de_DE.UTF-8"; LC_IDENTIFICATION = "de_DE.UTF-8"; @@ -116,16 +115,17 @@ LC_TIME = "de_DE.UTF-8"; }; - # Set console keymap. + # Configure console keymap console.keyMap = "de"; - # Enable the power-profiles-daemon service for improved battery management. + # Enable the power-profiles-daemon service for improved battery health services.power-profiles-daemon.enable = true; - # Enable printing. + # Enable CUPS to print documents. services.printing.enable = true; - # Sound configuration based on pipewire. + # Enable sound with pipewire. + sound.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { @@ -135,7 +135,7 @@ pulse.enable = true; }; - # Bluetooth configuration. + # Enable bluetooth on boot hardware.bluetooth = { enable = true; powerOnBoot = true; @@ -143,6 +143,7 @@ settings = { General = { + Disable = "Handsfree"; ControllerMode = "dual"; FastConnectable = "true"; Experimental = "true"; @@ -151,40 +152,73 @@ }; }; - # Enable flatpak support. + services.blueman.enable = true; + + # Enable flatpak services.flatpak.enable = true; - # Enable iio-sensor for automatic screen rotation and similar features. + programs.steam = { + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; + + # Enable automatic screen rotation and similar features hardware.sensor.iio.enable = true; - # Configure system-wide default shell. + # Enable docker + virtualisation.docker.enable = true; + + # Configure keymap in X11 + services.xserver = { + xkb.layout = "de"; + xkb.variant = ""; + }; + + # Configure fish as the default shell environment.shells = with pkgs; [ fish ]; users.defaultUserShell = pkgs.fish; programs.fish.enable = true; - # Configure users. - snowfallorg.users.jo.admin = true; + # Define user accounts + users.users = { + jo = { + isNormalUser = true; + description = "Jo"; + initialPassword = "jo"; + extraGroups = [ "networkmanager" "wheel" "docker" "tty" "dialout" ]; + }; - # Configure home-manager - home-manager = { - backupFileExtension = "homeManagerBackup"; + work = { + isNormalUser = true; + description = "Work account"; + initialPassword = "work"; + extraGroups = [ "networkmanager" "wheel" "docker" ]; + }; + + gaming = { + isNormalUser = true; + description = "Gaming account"; + initialPassword = "gaming"; + extraGroups = [ "networkmanager" "wheel" ]; + }; }; - # Provide users with some sane default packages. environment.systemPackages = with pkgs; [ - ### General nano firefox vlc + libreoffice spotify - ### Bluetooth + # Bluetooth bluez + bluez-tools - ### Fonts + # Fonts noto-fonts noto-fonts-color-emoji ]; + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = "23.05"; } diff --git a/systems/x86_64-linux/puzzlevision/hardware-configuration.nix b/hosts/puzzlevision/hardware-configuration.nix similarity index 71% rename from systems/x86_64-linux/puzzlevision/hardware-configuration.nix rename to hosts/puzzlevision/hardware-configuration.nix index 23031e0..d27d0ae 100644 --- a/systems/x86_64-linux/puzzlevision/hardware-configuration.nix +++ b/hosts/puzzlevision/hardware-configuration.nix @@ -8,7 +8,7 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "vmd" "nvme" "usbhid" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "vmd" "nvme" "rtsx_pci_sdmmc" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; @@ -27,6 +27,12 @@ options = [ "fmask=0022" "dmask=0022" ]; }; + fileSystems."/var/lib/docker/btrfs" = + { device = "/@/var/lib/docker/btrfs"; + fsType = "none"; + options = [ "bind" ]; + }; + swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking @@ -34,17 +40,8 @@ # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.br-01571e4eda2f.useDHCP = lib.mkDefault true; - # networking.interfaces.br-20785fae249b.useDHCP = lib.mkDefault true; - # networking.interfaces.br-64a49a5722c1.useDHCP = lib.mkDefault true; - # networking.interfaces.br-71e5fc5962fc.useDHCP = lib.mkDefault true; - # networking.interfaces.br-7df9905783da.useDHCP = lib.mkDefault true; # networking.interfaces.br-9b746f4e7e2f.useDHCP = lib.mkDefault true; - # networking.interfaces.br-e2f470a56dfe.useDHCP = lib.mkDefault true; # networking.interfaces.docker0.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s13f0u4u4.useDHCP = lib.mkDefault true; - # networking.interfaces.veth4e96b46.useDHCP = lib.mkDefault true; - # networking.interfaces.veth96a5ccd.useDHCP = lib.mkDefault true; # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix new file mode 100644 index 0000000..6a2b195 --- /dev/null +++ b/modules/home-manager/default.nix @@ -0,0 +1,16 @@ +{ + themes = { + gruvbox = { + plasma = import ./themes/gruvbox/plasma.nix; + }; + + catppuccin = { + gnome = import ./themes/catppuccin/gnome.nix; + global = import ./themes/catppuccin/global.nix; + }; + }; + + development = { + ssh = import ./development/ssh.nix; + }; +} \ No newline at end of file diff --git a/modules/home/development/ssh/default.nix b/modules/home-manager/development/ssh.nix similarity index 58% rename from modules/home/development/ssh/default.nix rename to modules/home-manager/development/ssh.nix index a3e60d1..66ef821 100644 --- a/modules/home/development/ssh/default.nix +++ b/modules/home-manager/development/ssh.nix @@ -1,18 +1,8 @@ { - lib, pkgs, - inputs, - - namespace, # The flake namespace, set in flake.nix. If not set, defaults to "internal". - system, # The home architecture for this host (eg. `x86_64-linux`). - target, # The Snowfall Lib target for this home (eg. `x86_64-home`). - format, # A normalized name for the home target (eg. `home`). - virtual, # A boolean to determine whether this home is a virtual target using nixos-generators. - host, # The host name for this home. - config, ... -}: let +}: let sshDir = "${config.home.homeDirectory}/.ssh"; in { home.packages = with pkgs; [ @@ -32,17 +22,19 @@ in { user = "git"; }; + "gitlab.com" = { identityFile = "${sshDir}/id_ed25519"; identitiesOnly = true; user = "git"; }; + "bitbucket.org" = { identityFile = "${sshDir}/id_ed25519"; identitiesOnly = true; user = "git"; }; - }; + }; }; -} \ No newline at end of file +} diff --git a/modules/home-manager/themes/catppuccin/global.nix b/modules/home-manager/themes/catppuccin/global.nix new file mode 100644 index 0000000..261dda9 --- /dev/null +++ b/modules/home-manager/themes/catppuccin/global.nix @@ -0,0 +1,17 @@ +{ + inputs, + pkgs, + outputs, + lib, + ... +}: { + catppuccin = { + enable = true; + accent = "blue"; + flavor = "frappe"; + + pointerCursor.enable = true; + pointerCursor.accent = "blue"; + pointerCursor.flavor = "frappe"; + }; +} diff --git a/modules/home-manager/themes/catppuccin/gnome.nix b/modules/home-manager/themes/catppuccin/gnome.nix new file mode 100644 index 0000000..9d673c1 --- /dev/null +++ b/modules/home-manager/themes/catppuccin/gnome.nix @@ -0,0 +1,46 @@ +{ + inputs, + pkgs, + outputs, + lib, + ... +}: { + gtk = with pkgs; { + enable = true; + + font = { + name = "Cantarell"; + size = 12; + package = cantarell-fonts; + }; + + catppuccin = { + icon.enable = true; + icon.accent = "blue"; + icon.flavor = "frappe"; + }; + + theme = { + name = "Colloid-Dark-Catppuccin"; + package = colloid-gtk-theme.override { + themeVariants = ["default"]; + colorVariants = ["dark"]; + sizeVariants = ["standard"]; + tweaks = ["catppuccin"]; + }; + }; + }; + + dconf.settings = { + # ---------------------- Theming + "org/gnome/desktop/background" = { + picture-uri = "${outputs.resources.wallpapers}/animals_at_campfire.jpg"; + picture-uri-dark = "${outputs.resources.wallpapers}/animals_at_campfire.jpg"; + }; + + "org/gnome/shell/extensions/user-theme" = { + name = "Colloid-Dark-Catppuccin"; + }; + # ---------------------- Theming END + }; +} diff --git a/modules/home-manager/themes/gruvbox/plasma.nix b/modules/home-manager/themes/gruvbox/plasma.nix new file mode 100644 index 0000000..677cb9c --- /dev/null +++ b/modules/home-manager/themes/gruvbox/plasma.nix @@ -0,0 +1,18 @@ +{ + inputs, + pkgs, + outputs, + lib, + ... +}: { + home.packages = with pkgs; [ + tela-icon-theme + outputs.packages.x86_64-linux.themes.kde-gruvbox-colors + ]; + + programs.plasma.workspace = { + iconTheme = "Tela-green-dark"; + colorScheme = "GruvboxColors"; + wallpaper = "${outputs.resources.wallpapers}/gruvbox/green_pokemon_guy.png"; + }; +} \ No newline at end of file diff --git a/modules/home/themes/catppuccin/fish/default.nix b/modules/home/themes/catppuccin/fish/default.nix deleted file mode 100644 index a968f3f..0000000 --- a/modules/home/themes/catppuccin/fish/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - lib, - pkgs, - inputs, - - namespace, # The flake namespace, set in flake.nix. If not set, defaults to "internal". - system, - target, # The Snowfall Lib target for this home (eg. `x86_64-home`). - format, # A normalized name for the home target (eg. `home`). - virtual, # A boolean to determine whether this home is a virtual target using nixos-generators. - host, # The host name for this home. - - config, - ... -}: { - home.file.".config/fish/themes/Catppuccin\ Frappe.theme".source = lib.snowfall.fs.get-file "resources/apps/fish/Catppuccin\ Frappe.theme"; -} \ No newline at end of file diff --git a/modules/home/themes/catppuccin/global/default.nix b/modules/home/themes/catppuccin/global/default.nix deleted file mode 100644 index 8433cba..0000000 --- a/modules/home/themes/catppuccin/global/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - lib, - pkgs, - inputs, - - namespace, # The flake namespace, set in flake.nix. If not set, defaults to "internal". - system, - target, # The Snowfall Lib target for this home (eg. `x86_64-home`). - format, # A normalized name for the home target (eg. `home`). - virtual, # A boolean to determine whether this home is a virtual target using nixos-generators. - host, # The host name for this home. - - config, - ... -}: { - catppuccin = { - enable = true; - accent = "blue"; - flavor = "frappe"; - - pointerCursor.enable = true; - pointerCursor.accent = "blue"; - pointerCursor.flavor = "frappe"; - }; -} \ No newline at end of file diff --git a/modules/home/themes/catppuccin/gnome/default.nix b/modules/home/themes/catppuccin/gnome/default.nix deleted file mode 100644 index 037134b..0000000 --- a/modules/home/themes/catppuccin/gnome/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - lib, - pkgs, - inputs, - - namespace, # The flake namespace, set in flake.nix. If not set, defaults to "internal". - system, - target, # The Snowfall Lib target for this home (eg. `x86_64-home`). - format, # A normalized name for the home target (eg. `home`). - virtual, # A boolean to determine whether this home is a virtual target using nixos-generators. - host, # The host name for this home. - - config, - ... -}: { - gtk = { - enable = true; - - font = { - name = "Cantarell"; - size = 12; - package = pkgs.cantarell-fonts; - }; - - catppuccin = { - icon = { - enable = true; - accent = "blue"; - flavor = "frappe"; - }; - }; - - theme = { - name = "Colloid-Dark-Catppuccin"; - package = pkgs.colloid-gtk-theme.override { - themeVariants = ["default"]; - colorVariants = ["dark"]; - sizeVariants = ["standard"]; - tweaks = ["catppuccin"]; - }; - }; - }; - - dconf.settings = { - "org/gnome/desktop/background" = { - picture-uri = lib.snowfall.fs.get-file "resources/wallpapers/pond_sidewalk_dusk.jpg"; - picture-uri-dark = lib.snowfall.fs.get-file "resources/wallpapers/pond_sidewalk_dusk.jpg"; - }; - - "org/gnome/shell/extensions/user-theme" = { - name = "Colloid-Dark-Catppuccin"; - }; - - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - cursor-theme = "catppuccin-frappe-blue-cursors"; - }; - }; -} \ No newline at end of file diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 0000000..ecd07d6 --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,7 @@ +{ + desktop = { + kde = import ./desktop/kde.nix; + gnome = import ./desktop/gnome.nix; + cosmic = import ./desktop/cosmic.nix; + }; +} \ No newline at end of file diff --git a/modules/nixos/desktop/cosmic.nix b/modules/nixos/desktop/cosmic.nix new file mode 100644 index 0000000..976cb41 --- /dev/null +++ b/modules/nixos/desktop/cosmic.nix @@ -0,0 +1,16 @@ +{ + inputs, + lib, + config, + pkgs, + ... +}: { + # Enable the x11 windowing system + services.xserver.enable = true; + + # Enable Cosmic DE + services.desktopManager.cosmic.enable = true; + + # Enable Cosmic greeter + services.displayManager.cosmic-greeter.enable = true; +} diff --git a/modules/nixos/common/gnome/default.nix b/modules/nixos/desktop/gnome.nix similarity index 54% rename from modules/nixos/common/gnome/default.nix rename to modules/nixos/desktop/gnome.nix index f9a2fb4..8f7ba51 100644 --- a/modules/nixos/common/gnome/default.nix +++ b/modules/nixos/desktop/gnome.nix @@ -1,38 +1,31 @@ { - lib, - pkgs, inputs, - - namespace, # The flake namespace, set in flake.nix. If not set, defaults to "internal". - system, # The system architecture for this host (eg. `x86_64-linux`). - target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). - format, # A normalized name for the system target (eg. `iso`). - virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. - systems, # An attribute map of your defined hosts. - + lib, config, + pkgs, ... }: { + # Enable the X11 windowing system. services.xserver.enable = true; - # Enable GNOME and GDM. + # Enable the GNOME Desktop Environment. services.xserver.displayManager.gdm.enable = true; services.xserver.desktopManager.gnome.enable = true; - environment.gnome.excludePackages = (with pkgs; [ + environment.gnome.excludePackages = (with pkgs; [ gnome-tour gedit - cheese - geary - yelp # Help view - epiphany # Gnome web ]) ++ (with pkgs.gnome; [ + cheese gnome-music + epiphany # Gnome web tali # Poker game iagno # Go game hitori # Sudoku game + yelp # Help view gnome-contacts gnome-initial-setup + geary ]); programs.dconf.enable = true; @@ -45,6 +38,6 @@ }; environment.systemPackages = with pkgs; [ - gnome-tweaks + gnome.gnome-tweaks ]; -} +} \ No newline at end of file diff --git a/modules/nixos/desktop/kde.nix b/modules/nixos/desktop/kde.nix new file mode 100644 index 0000000..604b96e --- /dev/null +++ b/modules/nixos/desktop/kde.nix @@ -0,0 +1,24 @@ +{ + inputs, + lib, + config, + pkgs, + ... +}: { + # Enable the x11 windowing system + services.xserver.enable = true; + + # Enable the SDDM display manager. + services.displayManager.sddm.enable = true; + + # Enable the KDE Plasma 6 desktop environment. + services.desktopManager.plasma6.enable = true; + + # Enable KDE-Connect + programs.kdeconnect.enable = true; + + # On-screen keyboard dependency + environment.systemPackages = with pkgs; [ + maliit-keyboard + ]; +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..7cb14e4 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,12 @@ +# Custom packages, that can be defined similarly to ones from nixpkgs +# You can build them using 'nix build .#example' +pkgs: { + # example = pkgs.callPackage ./example { }; + themes = { + kde-gruvbox-colors = pkgs.callPackage ./themes/kde-gruvbox-colors.nix { }; + }; + + gnomeExtensions = { + rounded-window-corners = pkgs.callPackage ./gnomeExtensions/rounded-window-corners.nix { }; + }; +} diff --git a/pkgs/gnomeExtensions/rounded-window-corners.nix b/pkgs/gnomeExtensions/rounded-window-corners.nix new file mode 100644 index 0000000..f504a9d --- /dev/null +++ b/pkgs/gnomeExtensions/rounded-window-corners.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchFromGitHub, pkgs }: + +stdenv.mkDerivation rec { + pname = "rounded-window-corners"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "flexagoon"; + repo = pname; + rev = "61c326e3d6cba36fe3d07cf1c15e6c74d3f9abb1"; + sha256 = "sha256-jS6G9wSKSXAxNhCmuew6pTcYa1gTZqbfrcAZ0ky4vkc="; + }; + + buildInputs = with pkgs; [ nodejs_22 gettext just ]; + + installPhase = '' + runHook preInstall + + just install + + mkdir -p $out/share/gnome-shell/extensions + cp ~/.local/share/gnome-shell/extensions/rounded-window-corners@fxgn $out/share/gnome-shell/extensions/rounded-window-corners@fxgn + + runHook postInstall + ''; +} \ No newline at end of file diff --git a/pkgs/themes/kde-gruvbox-colors.nix b/pkgs/themes/kde-gruvbox-colors.nix new file mode 100644 index 0000000..72c805e --- /dev/null +++ b/pkgs/themes/kde-gruvbox-colors.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "kde-gruvbox-colors"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "jokiller230"; + repo = pname; + rev = "438a23c571e22c1bf416c229afac78ad64e81f17"; + sha256 = "sha256-5iRfWqqtv+ImDN96PuWaS3nuK8AHjfa4DGc8vCkLi4U="; + }; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share + cp -R color-schemes konsole $out/share + + runHook postInstall + ''; +} \ No newline at end of file diff --git a/resources/default.nix b/resources/default.nix new file mode 100644 index 0000000..8470c52 --- /dev/null +++ b/resources/default.nix @@ -0,0 +1,4 @@ +{ + wallpapers = ./wallpapers; + app-files = ./programm-files; +} diff --git a/resources/programm-files/blackbox/Catppuccin-Macchiato.json b/resources/programm-files/blackbox/Catppuccin-Macchiato.json new file mode 100644 index 0000000..2435532 --- /dev/null +++ b/resources/programm-files/blackbox/Catppuccin-Macchiato.json @@ -0,0 +1,35 @@ +{ + "name": "Catppuccin-Macchiato", + "comment": "Soothing pastel theme for the high-spirited!", + "background-color": "#24273A", + "foreground-color": "#CAD3F5", + "badge-color": "#5B6078", + "bold-color": "#5B6078", + "cursor-background-color": "#F4DBD6", + "cursor-foreground-color": "#24273A", + "highlight-background-color": "#F4DBD6", + "highlight-foreground-color": "#24273A", + "palette": [ + "#494D64", + "#ED8796", + "#A6DA95", + "#EED49F", + "#8AADF4", + "#F5BDE6", + "#8BD5CA", + "#B8C0E0", + "#5B6078", + "#ED8796", + "#A6DA95", + "#EED49F", + "#8AADF4", + "#F5BDE6", + "#8BD5CA", + "#A5ADCB" + ], + "use-badge-color": false, + "use-bold-color": false, + "use-cursor-color": true, + "use-highlight-color": true, + "use-theme-colors": false +} diff --git a/resources/apps/fish/Catppuccin Frappe.theme b/resources/programm-files/fish/Catppuccin Frappe.theme similarity index 100% rename from resources/apps/fish/Catppuccin Frappe.theme rename to resources/programm-files/fish/Catppuccin Frappe.theme diff --git a/resources/wallpapers/animals_at_campfire.jpg b/resources/wallpapers/animals_at_campfire.jpg new file mode 100644 index 0000000..cc76e9a Binary files /dev/null and b/resources/wallpapers/animals_at_campfire.jpg differ diff --git a/resources/wallpapers/gruvbox/green_pokemon_guy.png b/resources/wallpapers/gruvbox/green_pokemon_guy.png new file mode 100644 index 0000000..df57eb7 Binary files /dev/null and b/resources/wallpapers/gruvbox/green_pokemon_guy.png differ diff --git a/resources/wallpapers/pond_sidewalk_dusk.jpg b/resources/wallpapers/pond_sidewalk_dusk.jpg deleted file mode 100644 index cfbf7d6..0000000 Binary files a/resources/wallpapers/pond_sidewalk_dusk.jpg and /dev/null differ diff --git a/users/gaming/desktop/plasma.nix b/users/gaming/desktop/plasma.nix new file mode 100644 index 0000000..85aa0e8 --- /dev/null +++ b/users/gaming/desktop/plasma.nix @@ -0,0 +1,27 @@ +{ + inputs, + lib, + config, + pkgs, + outputs, + ... +}: { + imports = [ + inputs.plasma-manager.homeManagerModules.plasma-manager + outputs.homeManagerModules.themes.gruvbox.plasma + ]; + + home.packages = with pkgs; [ + kdePackages.sierra-breeze-enhanced + kde-rounded-corners + ]; + + # Plasma configuration + programs.plasma = { + enable = true; + + workspace = { + clickItemTo = "select"; + }; + }; +} \ No newline at end of file diff --git a/users/gaming/home.nix b/users/gaming/home.nix new file mode 100644 index 0000000..9c5d872 --- /dev/null +++ b/users/gaming/home.nix @@ -0,0 +1,43 @@ +{ + inputs, + lib, + config, + pkgs, + outputs, + ... +}: { + imports = [ + ./desktop/plasma.nix + ]; + + nixpkgs = { + config = { + allowUnfree = true; + + # Workaround for https://github.com/nix-community/home-manager/issues/2942 + allowUnfreePredicate = _: true; + }; + }; + + # Username and home directory + home = { + username = "gaming"; + homeDirectory = "/home/gaming"; + }; + + # General packages + home.packages = with pkgs; [ + lutris + vesktop + steam + lunar-client + ]; + + # Enable home-manager + programs.home-manager.enable = true; + + # Nicely reload system units when changing configs + systemd.user.startServices = "sd-switch"; + + home.stateVersion = "23.05"; +} diff --git a/users/jo/apps/blackbox.nix b/users/jo/apps/blackbox.nix new file mode 100644 index 0000000..355f400 --- /dev/null +++ b/users/jo/apps/blackbox.nix @@ -0,0 +1,9 @@ +{ + inputs, + pkgs, + outputs, + lib, + ... +}: { + home.file.".local/share/blackbox/schemes/Catppuccin-Macchiato.json".source = "${outputs.resources.app-files}/blackbox/Catppuccin-Macchiato.json"; +} diff --git a/users/jo/apps/fish.nix b/users/jo/apps/fish.nix new file mode 100644 index 0000000..629b486 --- /dev/null +++ b/users/jo/apps/fish.nix @@ -0,0 +1,9 @@ +{ + inputs, + pkgs, + outputs, + lib, + ... +}: { + home.file.".config/fish/themes/Catppuccin\ Frappe.theme".source = "${outputs.resources.app-files}/fish/Catppuccin\ Frappe.theme"; +} diff --git a/users/jo/apps/librewolf.nix b/users/jo/apps/librewolf.nix new file mode 100644 index 0000000..f785e22 --- /dev/null +++ b/users/jo/apps/librewolf.nix @@ -0,0 +1,11 @@ +{ + inputs, + pkgs, + outputs, + lib, + ... +}: { + home.file.".librewolf/librewolf.overrides.cfg".text = '' + defaultPref("identity.fxaccounts.enabled", true); + ''; +} diff --git a/homes/x86_64-linux/jo@puzzlevision/apps/gnome.nix b/users/jo/desktop/gnome.nix similarity index 77% rename from homes/x86_64-linux/jo@puzzlevision/apps/gnome.nix rename to users/jo/desktop/gnome.nix index 42d78b6..fc902f1 100644 --- a/homes/x86_64-linux/jo@puzzlevision/apps/gnome.nix +++ b/users/jo/desktop/gnome.nix @@ -1,18 +1,14 @@ { - lib, - pkgs, inputs, - - namespace, # The flake namespace, set in flake.nix. If not set, defaults to "internal". - home, # The home architecture for this host (eg. `x86_64-linux`). - target, # The Snowfall Lib target for this home (eg. `x86_64-home`). - format, # A normalized name for the home target (eg. `home`). - virtual, # A boolean to determine whether this home is a virtual target using nixos-generators. - host, # The host name for this home. - - config, + pkgs, + outputs, + lib, ... }: { + imports = [ + outputs.homeManagerModules.themes.catppuccin.gnome + ]; + home.packages = with pkgs.gnomeExtensions; [ dash-to-dock user-themes @@ -24,6 +20,11 @@ # Use `dconf watch /` to track stateful changes you are doing, then set them here. dconf.settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + cursor-theme = "catppuccin-frappe-blue-cursors"; + }; + "org/gnome/shell" = { favorite-apps = [ "org.gnome.Nautilus.desktop" @@ -65,4 +66,4 @@ window-buttons-theme = "catppuccin"; }; }; -} \ No newline at end of file +} diff --git a/users/jo/desktop/kde.nix b/users/jo/desktop/kde.nix new file mode 100644 index 0000000..85aa0e8 --- /dev/null +++ b/users/jo/desktop/kde.nix @@ -0,0 +1,27 @@ +{ + inputs, + lib, + config, + pkgs, + outputs, + ... +}: { + imports = [ + inputs.plasma-manager.homeManagerModules.plasma-manager + outputs.homeManagerModules.themes.gruvbox.plasma + ]; + + home.packages = with pkgs; [ + kdePackages.sierra-breeze-enhanced + kde-rounded-corners + ]; + + # Plasma configuration + programs.plasma = { + enable = true; + + workspace = { + clickItemTo = "select"; + }; + }; +} \ No newline at end of file diff --git a/users/jo/home.nix b/users/jo/home.nix new file mode 100644 index 0000000..be22501 --- /dev/null +++ b/users/jo/home.nix @@ -0,0 +1,124 @@ +{ + inputs, + lib, + config, + pkgs, + outputs, + ... +}: { + imports = [ + ./desktop/gnome.nix + ./apps/fish.nix + ./apps/blackbox.nix + ./apps/librewolf.nix + outputs.homeManagerModules.themes.catppuccin.global + outputs.homeManagerModules.development.ssh + ]; + + nixpkgs = { + config = { + allowUnfree = true; + + # Workaround for https://github.com/nix-community/home-manager/issues/2942 + allowUnfreePredicate = _: true; + }; + }; + + # Username and home directory + home = { + username = "jo"; + homeDirectory = "/home/jo"; + }; + + # Flatpak packages + services.flatpak = { + enable = true; + update.auto.enable = true; + uninstallUnmanaged = true; + + packages = [ + "com.jeffser.Alpaca" + "dev.aunetx.deezer" + ]; + }; + + # General packages + home.packages = with pkgs; [ + qflipper + wineWowPackages.waylandFull + vesktop + lunar-client + steam + g4music + librewolf + + # For development + avra + avrdude + jetbrains.phpstorm + git + nodejs_22 + bun + termius + blackbox-terminal + forge-sparks + devenv + + # Work stuff for when I'm not actually working + teams-for-linux + enpass + + # Notes and Organisation + obsidian + + # File synchronization + celeste + ]; + + # Enable home-manager + programs.home-manager.enable = true; + + # Enable and configure git + programs.git = { + enable = true; + + userEmail = "jo@thevoid.cafe"; + userName = "Jo"; + + extraConfig = { + user = { + signingkey = "$HOME/.ssh/id_ed25519"; + }; + + init = { + defaultBranch = "main"; + }; + + color = { + ui = true; + }; + }; + }; + + programs.gh = { + enable = true; + + gitCredentialHelper = { + enable = true; + + hosts = [ + "https://github.com" + "https://gist.github.com" + "https://git.thevoid.cafe" + "https://gitlab.org" + "https://git.semiko.dev" + "https://bitbucket.org" + ]; + }; + }; + + # Nicely reload system units when changing configs + systemd.user.startServices = "sd-switch"; + + home.stateVersion = "23.05"; +} diff --git a/users/work/desktop/plasma.nix b/users/work/desktop/plasma.nix new file mode 100644 index 0000000..85aa0e8 --- /dev/null +++ b/users/work/desktop/plasma.nix @@ -0,0 +1,27 @@ +{ + inputs, + lib, + config, + pkgs, + outputs, + ... +}: { + imports = [ + inputs.plasma-manager.homeManagerModules.plasma-manager + outputs.homeManagerModules.themes.gruvbox.plasma + ]; + + home.packages = with pkgs; [ + kdePackages.sierra-breeze-enhanced + kde-rounded-corners + ]; + + # Plasma configuration + programs.plasma = { + enable = true; + + workspace = { + clickItemTo = "select"; + }; + }; +} \ No newline at end of file diff --git a/users/work/home.nix b/users/work/home.nix new file mode 100644 index 0000000..b38feec --- /dev/null +++ b/users/work/home.nix @@ -0,0 +1,39 @@ +{ + pkgs, + lib, + outputs, + inputs, + config, + ... +}: { + imports = [ + ./desktop/plasma.nix + outputs.homeManagerModules.development.ssh + ]; + + nixpkgs = { + config = { + allowUnfree = true; + + # Workaround for https://github.com/nix-community/home-manager/issues/2942 + allowUnfreePredicate = _: true; + }; + }; + + home = { + username = "work"; + homeDirectory = "/home/work"; + }; + + home.packages = with pkgs; [ + jetbrains.phpstorm + thunderbird + teams-for-linux + enpass + vscodium + ]; + + systemd.user.startServices = "sd-switch"; + + home.stateVersion = "23.05"; +}