Personal Nix flake
nixos home-manager nix
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: Rework profiles

Demote kernel, pipewire, users, virtualization and wayland profiles to
regular modules, as it doesn't fit with the idea of orthogonal
generalized roles

Add assertions to DE/graphical/gui profiles so they aren't accidentally
activated without config.hardware.graphics.enable

+108 -82
+1 -1
nix/home/configs/cheina@pc082.nix
··· 16 16 cli.hishtory.enable = false; 17 17 de.gnome.theming.enableGnomeShellTheme = false; 18 18 development.nixd.lsp.enable = false; 19 + wayland.enable = true; 19 20 profiles = { 20 21 standalone = true; 21 - wayland = true; 22 22 }; 23 23 }; 24 24
+8 -4
nix/home/modules/de/hyprland/hypridle/default.nix
··· 18 18 }; 19 19 20 20 config = lib.mkIf cfg.enable { 21 + assertions = [ 22 + { 23 + assertion = config.services.hypridle.settings.general.lock_cmd != null; 24 + message = "config.services.hypridle.settings.general.lock_cmd must be set for hypridle to work properly"; 25 + } 26 + ]; 27 + 21 28 services.hypridle = { 22 - enable = 23 - if (cfg.lockCmd == null) 24 - then (throw "config.services.hypridle.settings.general.lock_cmd must be set") 25 - else true; 29 + enable = true; 26 30 settings = { 27 31 general = { 28 32 lock_cmd = cfg.lockCmd;
+1
nix/home/modules/default.nix
··· 32 32 ./ssh 33 33 ./syncthing 34 34 ./theming 35 + ./wayland 35 36 ../profiles 36 37 ]; 37 38
+7
nix/home/modules/gui/default.nix
··· 19 19 options.my.gui.enable = lib.mkEnableOption "gui apps"; 20 20 21 21 config = lib.mkIf cfg.enable { 22 + assertions = [ 23 + { 24 + assertion = osConfig == {} || osConfig.hardware.graphics.enable; 25 + message = "config.my.gui.enable is useless without graphics"; 26 + } 27 + ]; 28 + 22 29 home.packages = with pkgs; [ 23 30 libreoffice-qt6-fresh 24 31 obsidian
+2 -2
nix/home/modules/gui/media.nix
··· 8 8 inherit (pkgs.stdenv.hostPlatform) system; 9 9 cfg = config.my.gui.media; 10 10 in { 11 - options.my.gui.media = lib.mkEnableOption "gui media apps" // {default = config.my.gui.enable;}; 12 - config = lib.mkIf cfg { 11 + options.my.gui.media.enable = lib.mkEnableOption "gui media apps" // {default = config.my.gui.enable;}; 12 + config = lib.mkIf cfg.enable { 13 13 programs = { 14 14 mpv.enable = true; 15 15 spicetify = let
+22
nix/home/modules/wayland/default.nix
··· 1 + { 2 + config, 3 + lib, 4 + osConfig ? {}, 5 + pkgs, 6 + ... 7 + }: let 8 + cfg = config.my.wayland; 9 + in { 10 + options.my.wayland.enable = 11 + lib.mkEnableOption "wayland tweaks" 12 + // {default = osConfig.my.wayland.enable or false;}; 13 + config = lib.mkIf cfg.enable { 14 + home.packages = [pkgs.wl-clipboard]; 15 + home.sessionVariables.NIXOS_OZONE_WL = "1"; 16 + 17 + services.cliphist = { 18 + enable = true; 19 + allowImages = true; 20 + }; 21 + }; 22 + }
-1
nix/home/profiles/default.nix
··· 4 4 ./graphical.nix 5 5 ./llm 6 6 ./standalone.nix 7 - ./wayland.nix 8 7 ]; 9 8 }
-22
nix/home/profiles/wayland.nix
··· 1 - { 2 - config, 3 - lib, 4 - osConfig ? {}, 5 - pkgs, 6 - ... 7 - }: let 8 - cfg = config.my.profiles.wayland; 9 - in { 10 - options.my.profiles.wayland = 11 - lib.mkEnableOption "wayland profile" 12 - // {default = osConfig.my.profiles.wayland or false;}; 13 - config = lib.mkIf cfg { 14 - home.packages = [pkgs.wl-clipboard]; 15 - home.sessionVariables.NIXOS_OZONE_WL = "1"; 16 - 17 - services.cliphist = { 18 - enable = true; 19 - allowImages = true; 20 - }; 21 - }; 22 - }
+1 -1
nix/nixos/configs/steamdeck/default.nix
··· 17 17 gaming.enable = false; 18 18 gaming.steam.enable = true; 19 19 security.u2f.relaxed = true; 20 + kernel.enable = false; 20 21 profiles = { 21 22 de.gnome = true; 22 23 graphical = true; 23 - kernel = false; 24 24 }; 25 25 }; 26 26
+8 -6
nix/nixos/modules/default.nix
··· 27 27 ./gaming 28 28 ./hardware 29 29 ./kdeconnect 30 + ./kernel 30 31 ./locale 31 32 ./networking 32 33 ./nix 34 + ./pipewire 33 35 ./programs 34 36 ./secrets 35 37 ./secureboot ··· 39 41 ./syncthing 40 42 ./tailscale 41 43 ./theming 44 + ./users 45 + ./virtualization 46 + ./wayland 42 47 ./zram 43 48 ../profiles 44 49 ]; 45 50 46 51 my = { 52 + kernel.enable = mkDefault true; 47 53 networking.tailscale.enable = mkDefault true; 48 54 nix.enable = mkDefault true; 55 + pipewire.enable = mkDefault true; 49 56 security.enable = mkDefault true; 50 57 theming.enable = mkDefault true; 58 + users.enable = mkDefault true; 51 59 zram.enable = mkDefault true; 52 - profiles = { 53 - wayland = mkDefault config.my.profiles.graphical; 54 - pipewire = mkDefault true; 55 - kernel = mkDefault true; 56 - users = mkDefault true; 57 - }; 58 60 }; 59 61 60 62 environment.systemPackages = with pkgs; [
+21
nix/nixos/modules/virtualization/default.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: let 7 + cfg = config.my.virtualisation; 8 + in { 9 + options.my.virtualisation.enable = lib.mkEnableOption "virtualisation tweaks"; 10 + config = lib.mkIf cfg.enable { 11 + environment.systemPackages = with pkgs; [ 12 + distrobox 13 + ]; 14 + virtualisation = { 15 + docker = { 16 + enable = true; 17 + enableOnBoot = true; 18 + }; 19 + }; 20 + }; 21 + }
+14
nix/nixos/profiles/de/default.nix
··· 1 1 { 2 + config, 3 + lib, 4 + ... 5 + }: let 6 + cfg = config.my.profiles.de; 7 + in { 8 + assertions = 9 + cfg 10 + |> lib.filterAttrs (_: enabled: enabled) 11 + |> lib.mapAttrsToList (name: _: { 12 + assertion = config.hardware.graphics.enable; 13 + message = "config.my.profiles.de.${name} is useless without graphics"; 14 + }); 15 + 2 16 imports = [ 3 17 ./gnome.nix 4 18 ./hyprland.nix
-5
nix/nixos/profiles/de/hyprland.nix
··· 9 9 in { 10 10 options.my.profiles.de.hyprland = lib.mkEnableOption "hyprland profile"; 11 11 config = lib.mkIf cfg { 12 - my.profiles = { 13 - pipewire = true; 14 - wayland = true; 15 - }; 16 - 17 12 programs.hyprland = { 18 13 enable = true; 19 14 xwayland.enable = true;
-5
nix/nixos/profiles/default.nix
··· 4 4 ./formfactor 5 5 ./graphical.nix 6 6 ./hardware 7 - ./kernel.nix 8 - ./pipewire.nix 9 - ./users.nix 10 - ./virtualisation.nix 11 - ./wayland.nix 12 7 ]; 13 8 }
+4
nix/nixos/profiles/graphical.nix
··· 7 7 in { 8 8 options.my.profiles.graphical = lib.mkEnableOption "graphical profile"; 9 9 config = lib.mkIf cfg { 10 + my = { 11 + wayland.enable = true; 12 + }; 13 + 10 14 boot.plymouth.enable = true; 11 15 hardware = { 12 16 graphics.enable = true;
+3 -3
nix/nixos/profiles/kernel.nix nix/nixos/modules/kernel/default.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: let 7 - cfg = config.my.profiles.kernel; 7 + cfg = config.my.kernel; 8 8 in { 9 - options.my.profiles.kernel = lib.mkEnableOption "kernel profile"; 10 - config = lib.mkIf cfg { 9 + options.my.kernel.enable = lib.mkEnableOption "kernel tweaks"; 10 + config = lib.mkIf cfg.enable { 11 11 boot = lib.mkIf (!(config ? jovian)) { 12 12 kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; 13 13 kernelModules = [
+3 -3
nix/nixos/profiles/pipewire.nix nix/nixos/modules/pipewire/default.nix
··· 4 4 lib, 5 5 ... 6 6 }: let 7 - cfg = config.my.profiles.pipewire; 7 + cfg = config.my.pipewire; 8 8 in { 9 - options.my.profiles.pipewire = lib.mkEnableOption "pipewire profile"; 10 - config = lib.mkIf cfg { 9 + options.my.pipewire.enable = lib.mkEnableOption "pipewire tweaks"; 10 + config = lib.mkIf cfg.enable { 11 11 hardware.enableAllFirmware = true; 12 12 security.rtkit.enable = true; 13 13 services.pipewire = {
+3 -3
nix/nixos/profiles/users.nix nix/nixos/modules/users/default.nix
··· 10 10 }: let 11 11 inherit (inputs.self.lib.config) name shell; 12 12 userName = name.user; 13 - cfg = config.my.profiles.users; 13 + cfg = config.my.users; 14 14 in { 15 - options.my.profiles.users = lib.mkEnableOption "users profile"; 16 - config = lib.mkIf cfg { 15 + options.my.users.enable = lib.mkEnableOption "user tweaks"; 16 + config = lib.mkIf cfg.enable { 17 17 users = let 18 18 defaults = { 19 19 isNormalUser = true;
-21
nix/nixos/profiles/virtualisation.nix
··· 1 - { 2 - config, 3 - lib, 4 - pkgs, 5 - ... 6 - }: let 7 - cfg = config.my.profiles.virtualisation; 8 - in { 9 - options.my.profiles.virtualisation = lib.mkEnableOption "virtualisation profile"; 10 - config = lib.mkIf cfg { 11 - environment.systemPackages = with pkgs; [ 12 - distrobox 13 - ]; 14 - virtualisation = { 15 - docker = { 16 - enable = true; 17 - enableOnBoot = true; 18 - }; 19 - }; 20 - }; 21 - }
+10 -5
nix/nixos/profiles/wayland.nix nix/nixos/modules/wayland/default.nix
··· 6 6 pkgs, 7 7 ... 8 8 }: let 9 - cfg = config.my.profiles.wayland; 9 + cfg = config.my.wayland; 10 10 in { 11 - options.my.profiles.wayland = 12 - lib.mkEnableOption "wayland profile" 13 - // {default = config.my.profiles.graphical;}; 14 - config = lib.mkIf cfg { 11 + options.my.wayland.enable = lib.mkEnableOption "wayland tweaks"; 12 + config = lib.mkIf cfg.enable { 13 + assertions = [ 14 + { 15 + assertion = config.hardware.graphics.enable; 16 + message = "config.my.wayland.enable is useless without graphics"; 17 + } 18 + ]; 19 + 15 20 services.displayManager.gdm.wayland = true; 16 21 programs.xwayland.enable = true; 17 22