From ee6f29eb571a412fc75aa6086ca94bae745386a0 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 22 Dec 2024 22:26:41 -0800 Subject: [PATCH 01/43] refactor: modularize audio-prod, audio, wsl, wine, networking --- hosts/callisto/configuration.nix | 11 +++++ modules/default.nix | 30 ++++++++++++ modules/linux/audio-prod/default.nix | 32 +++++++++---- modules/linux/audio/default.nix | 33 +++++++++---- modules/linux/default.nix | 20 ++++++++ modules/linux/networking/default.nix | 72 +++++++++++++++++----------- modules/linux/spotifyd/default.nix | 13 ----- modules/linux/wine/default.nix | 35 ++++++++++---- modules/linux/wsl/default.nix | 27 +++++++++-- 9 files changed, 200 insertions(+), 73 deletions(-) create mode 100644 modules/default.nix create mode 100644 modules/linux/default.nix delete mode 100644 modules/linux/spotifyd/default.nix diff --git a/hosts/callisto/configuration.nix b/hosts/callisto/configuration.nix index 387a949..8612a45 100755 --- a/hosts/callisto/configuration.nix +++ b/hosts/callisto/configuration.nix @@ -14,6 +14,17 @@ # ./apple-silicon-support ]; + liminalOS = { + system = { + audio.enable = true; + networking = { + enable = true; + firewallPresets.vite = true; + cloudflareNameservers.enable = true; + }; + }; + }; + boot = { loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = false; diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..7a93bd2 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,30 @@ +{ + pkgs, + lib, + config, + ... +}: +let + cfg = config.liminalOS; +in +{ + imports = [ + ./linux + ]; + options.liminalOS = { + linux.enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Whether to enable liminalOS's default modules and options for Linux. + ''; + }; + darwin.enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Whether to enable liminalOS's default modules and options for Darwin. + ''; + }; + }; +} diff --git a/modules/linux/audio-prod/default.nix b/modules/linux/audio-prod/default.nix index e44a7ad..3bccf05 100644 --- a/modules/linux/audio-prod/default.nix +++ b/modules/linux/audio-prod/default.nix @@ -1,11 +1,25 @@ -{ pkgs, ... }: { - imports = [ - ../wine - ]; - environment.systemPackages = with pkgs; [ - reaper - yabridge - yabridgectl - ]; + pkgs, + lib, + config, + ... +}: +let + cfg = config.liminalOS.system.audio.prod; +in +{ + options.liminalOS.system.audio.prod.enable = lib.mkEnableOption "audio production"; + + config = lib.mkIf cfg.enable { + liminalOS = { + programs.wine.enable = true; + system.audio.enable = true; + }; + + environment.systemPackages = with pkgs; [ + reaper + yabridge + yabridgectl + ]; + }; } diff --git a/modules/linux/audio/default.nix b/modules/linux/audio/default.nix index fc4b7dd..ddb1a0a 100755 --- a/modules/linux/audio/default.nix +++ b/modules/linux/audio/default.nix @@ -1,14 +1,27 @@ +{ lib, config, ... }: +let + cfg = config.liminalOS.system.audio; +in { - # Enable sound with pipewire. - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; + options.liminalOS.system.audio.enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.linux.enable; + description = '' + Whether to set up PipeWire and default audio utilities. + ''; }; - services.playerctld.enable = true; + config = { + services.playerctld.enable = lib.mkIf cfg.enable true; + hardware.pulseaudio.enable = lib.mkIf cfg.enable false; + # TODO: move to other file + security.rtkit.enable = true; + services.pipewire = lib.mkIf cfg.enable { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + }; } diff --git a/modules/linux/default.nix b/modules/linux/default.nix new file mode 100644 index 0000000..c5df2b9 --- /dev/null +++ b/modules/linux/default.nix @@ -0,0 +1,20 @@ +{ lib, ... }: +{ + imports = [ + ./audio + ./audio-prod + ./core + ./desktop-portal + ./distrobox + ./flatpak + ./fonts + ./gaming + ./greeter + ./hamachi + ./networking + ./spotifyd + ./stylix + ./wine + ./wsl + ]; +} diff --git a/modules/linux/networking/default.nix b/modules/linux/networking/default.nix index 3af770e..58c7473 100755 --- a/modules/linux/networking/default.nix +++ b/modules/linux/networking/default.nix @@ -1,35 +1,53 @@ +{ lib, config, ... }: let - universalAllowedPorts = [ - 27016 # grim dawn - 42805 # grim dawn - 42852 # grim dawn - 42872 # grim dawn - 27015 # grim dawn - 27036 # grim dawn + cfg = config.liminalOS.system.networking; - 5173 # vite test server - 4173 # vite test server - ]; + universalAllowedPorts = + (lib.optionals cfg.firewallPresets.grimDawn [ + 27016 # grim dawn + 42805 # grim dawn + 42852 # grim dawn + 42872 # grim dawn + 27015 # grim dawn + 27036 # grim dawn + ]) + ++ (lib.optionals cfg.firewallPresets.vite [ + 5173 # vite test server + 4173 # vite test server + ]); universalAllowedRanges = [ ]; in { - services.openssh.enable = true; - - networking.firewall = { - enable = true; - allowedTCPPorts = universalAllowedPorts; - allowedUDPPorts = universalAllowedPorts; - allowedUDPPortRanges = universalAllowedRanges ++ [ - { - from = 27031; - to = 27036; - } - ]; - allowedTCPPortRanges = universalAllowedRanges; + options.liminalOS.system.networking = { + enable = lib.mkEnableOption "networking"; + firewallPresets = { + grimDawn = lib.mkEnableOption "firewall ports for Grim Dawn"; + vite = lib.mkEnableOption "firewall ports for Vite"; + }; + cloudflareNameservers.enable = lib.mkEnableOption "Cloudflare DNS servers"; }; - networking.nameservers = [ - "1.1.1.1" - "1.0.0.1" - ]; + config = lib.mkIf cfg.enable { + services.openssh.enable = true; + + networking.firewall = { + enable = true; + allowedTCPPorts = universalAllowedPorts; + allowedUDPPorts = universalAllowedPorts; + allowedUDPPortRanges = + universalAllowedRanges + ++ (lib.optionals cfg.firewallPresets.grimDawn [ + { + from = 27031; + to = 27036; + } + ]); + allowedTCPPortRanges = universalAllowedRanges; + }; + + networking.nameservers = lib.mkIf cfg.cloudflareNameservers.enable [ + "1.1.1.1" + "1.0.0.1" + ]; + }; } diff --git a/modules/linux/spotifyd/default.nix b/modules/linux/spotifyd/default.nix deleted file mode 100644 index d7657e1..0000000 --- a/modules/linux/spotifyd/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, ... }: -{ - services.spotifyd = { - enable = true; - settings = { - global = { - bitrate = 320; - use_mpris = true; - device_type = "computer"; - }; - }; - }; -} diff --git a/modules/linux/wine/default.nix b/modules/linux/wine/default.nix index efc4227..1e9479b 100644 --- a/modules/linux/wine/default.nix +++ b/modules/linux/wine/default.nix @@ -1,12 +1,27 @@ -{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ - winetricks - wine - ]; - nixpkgs.overlays = [ - (self: super: { - wine = super.wineWowPackages.stable; - }) - ]; + pkgs, + config, + lib, + ... +}: +let + cfg = config.liminalOS.programs.wine; +in +{ + options.liminalOS.programs.wine.enable = lib.mkEnableOption "wine"; + + config = lib.mkIf cfg.enable { + environment.systemPackages = ( + with pkgs; + [ + winetricks + wine + ] + ); + nixpkgs.overlays = [ + (self: super: { + wine = super.wineWowPackages.stable; + }) + ]; + }; } diff --git a/modules/linux/wsl/default.nix b/modules/linux/wsl/default.nix index da6d488..a3ac317 100644 --- a/modules/linux/wsl/default.nix +++ b/modules/linux/wsl/default.nix @@ -1,12 +1,31 @@ -{ inputs, ... }: { - imports = [ + inputs, + config, + lib, + ... +}: +let + cfg = config.liminalOS.wsl; +in +{ + imports = lib.mkIf cfg.enable [ inputs.nixos-wsl.nixosModules.default ]; - wsl = { + options = { + enable = lib.mkEnableOption "wsl"; + module = lib.mkOption { + type = lib.types.submodule; + default = inputs.nixos-wsl.nixosModules.default; + description = '' + NixOS WSL module. Defaults to + ''; + }; + }; + + config.wsl = lib.mkIf cfg.enable { enable = true; - defaultUser = "youwen"; + defaultUser = config.liminalOS.username; useWindowsDriver = true; }; } From ddfcbd78c80707b1f011bbf89a373cc8c0bbd437 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 22 Dec 2024 22:32:50 -0800 Subject: [PATCH 02/43] refactor: modularize gaming module and fold in hamachi --- modules/linux/gaming/default.nix | 108 +++++++++++------- modules/linux/hamachi/default.nix | 4 - .../youwen/linux/packages/x86_64/default.nix | 1 - 3 files changed, 64 insertions(+), 49 deletions(-) delete mode 100644 modules/linux/hamachi/default.nix diff --git a/modules/linux/gaming/default.nix b/modules/linux/gaming/default.nix index 8c0fc02..2e4493c 100755 --- a/modules/linux/gaming/default.nix +++ b/modules/linux/gaming/default.nix @@ -1,55 +1,75 @@ -{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ - ryujinx - mangohud - mangojuice - ]; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - gamescopeSession.enable = true; + pkgs, + lib, + config, + ... +}: +let + cfg = config.liminalOS.extras.gaming; +in +{ + options.liminalOS.extras.gaming = { + enable = lib.mkEnableOption "gaming"; + withHamachi = lib.mkEnableOption "hamachi"; }; + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + ryujinx + lutris + heroic + mangohud + mangojuice + ]; - programs.gamescope.enable = true; + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + gamescopeSession.enable = true; + }; - programs.gamemode = { - enable = true; - enableRenice = true; - settings = { - general = { - renice = 10; - }; - custom = { - start = "${pkgs.libnotify}/bin/notify-send 'GameMode engaged'"; - end = "${pkgs.libnotify}/bin/notify-send 'GameMode disengaged'"; + programs.gamescope.enable = true; + + programs.gamemode = { + enable = true; + enableRenice = true; + settings = { + general = { + renice = 10; + }; + custom = { + start = "${pkgs.libnotify}/bin/notify-send 'GameMode engaged'"; + end = "${pkgs.libnotify}/bin/notify-send 'GameMode disengaged'"; + }; }; }; - }; - users.users.youwen.extraGroups = [ "gamemode" ]; + users.users.${config.liminalOS.username}.extraGroups = [ "gamemode" ]; - nixpkgs.config.packageOverrides = pkgs: { - steam = pkgs.steam.override { - extraPkgs = - pkgs: with pkgs; [ - xorg.libXcursor - xorg.libXi - xorg.libXinerama - xorg.libXScrnSaver - libpng - libpulseaudio - libvorbis - stdenv.cc.cc.lib - libkrb5 - (writeShellScriptBin "launch-gamescope" '' - (sleep 1; pgrep gamescope| xargs renice -n -11 -p)& - exec gamescope "$@" - '') - keyutils - ]; + services.logmein-hamachi.enable = cfg.withHamachi; + programs.haguichi.enable = cfg.withHamachi; + + nixpkgs.config.packageOverrides = pkgs: { + steam = pkgs.steam.override { + extraPkgs = + pkgs: with pkgs; [ + xorg.libXcursor + xorg.libXi + xorg.libXinerama + xorg.libXScrnSaver + libpng + libpulseaudio + libvorbis + stdenv.cc.cc.lib + libkrb5 + (writeShellScriptBin "launch-gamescope" '' + (sleep 1; pgrep gamescope| xargs renice -n -11 -p)& + exec gamescope "$@" + '') + keyutils + ]; + }; }; }; } diff --git a/modules/linux/hamachi/default.nix b/modules/linux/hamachi/default.nix deleted file mode 100644 index 80be52a..0000000 --- a/modules/linux/hamachi/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - services.logmein-hamachi.enable = true; - programs.haguichi.enable = true; -} diff --git a/users/youwen/linux/packages/x86_64/default.nix b/users/youwen/linux/packages/x86_64/default.nix index 415aa94..035e094 100644 --- a/users/youwen/linux/packages/x86_64/default.nix +++ b/users/youwen/linux/packages/x86_64/default.nix @@ -12,7 +12,6 @@ in ++ (with pkgs; [ bitwarden-desktop modrinth-app - lutris sbctl r2modman zoom-us From 4c72a5cb8b09e90829b1a846bf9cbfc2f798961f Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 22 Dec 2024 23:26:13 -0800 Subject: [PATCH 03/43] refactor: modularize theming --- hosts/callisto/configuration.nix | 4 ++ hosts/callisto/default.nix | 1 - modules/linux/fonts/default.nix | 44 ++++++++++------ modules/linux/stylix/default.nix | 86 +++++++++++++++++++++----------- modules/linux/wsl/default.nix | 20 +++++--- 5 files changed, 102 insertions(+), 53 deletions(-) diff --git a/hosts/callisto/configuration.nix b/hosts/callisto/configuration.nix index 8612a45..4894167 100755 --- a/hosts/callisto/configuration.nix +++ b/hosts/callisto/configuration.nix @@ -22,6 +22,10 @@ firewallPresets.vite = true; cloudflareNameservers.enable = true; }; + fonts.enable = true; + }; + theming = { + enable = true; }; }; diff --git a/hosts/callisto/default.nix b/hosts/callisto/default.nix index 50d9d12..97308b1 100644 --- a/hosts/callisto/default.nix +++ b/hosts/callisto/default.nix @@ -11,7 +11,6 @@ ../../modules/linux/networking ../../modules/linux/fonts ../../modules/linux/greeter - # ../../modules/linux/spotifyd ../../modules/linux/core ../../modules/linux/desktop-portal ../../modules/linux/stylix diff --git a/modules/linux/fonts/default.nix b/modules/linux/fonts/default.nix index 2ac31de..a2b53b6 100755 --- a/modules/linux/fonts/default.nix +++ b/modules/linux/fonts/default.nix @@ -1,19 +1,31 @@ -{ pkgs, ... }: { - fonts = { - enableDefaultPackages = true; - # fontconfig = { - # defaultFonts = { - # serif = [ "Noto Serif" ]; - # sansSerif = [ "Noto Sans" ]; - # }; - # }; - packages = with pkgs; [ - # noto-fonts - noto-fonts-cjk-sans - # noto-fonts-emoji - # (nerdfonts.override { fonts = [ "CascadiaCode" ]; }) - (google-fonts.override { fonts = [ "Lora" ]; }) - ]; + pkgs, + lib, + config, + ... +}: +let + cfg = config.liminalOS.system.fonts; +in +{ + options.liminalOS.system.fonts = { + enable = lib.mkEnableOption "fonts"; + }; + + config = lib.mkIf cfg.enable { + fonts = { + enableDefaultPackages = true; + packages = + with pkgs; + [ + noto-fonts-cjk-sans + (google-fonts.override { fonts = [ "Lora" ]; }) + ] + ++ (lib.optionals (!config.liminalOS.theming.enable) [ + noto-fonts + noto-fonts-emoji + nerd-fonts.caskaydia-cove + ]); + }; }; } diff --git a/modules/linux/stylix/default.nix b/modules/linux/stylix/default.nix index 0ecf1fc..80dc3ee 100644 --- a/modules/linux/stylix/default.nix +++ b/modules/linux/stylix/default.nix @@ -1,40 +1,68 @@ -{ inputs, pkgs, ... }: { + inputs, + pkgs, + config, + lib, + ... +}: +let + cfg = config.liminalOS.theming; +in +{ + options.liminalOS.theming = { + enable = lib.mkEnableOption "theming"; + stylixName = lib.mkOption { + type = lib.types.str; + default = "stylix"; + description = '' + Name of Stylix module defined in `inputs`. Defaults to `stylix`. You must define `inputs.stylix.url` in your `flake.nix` to enable this option + ''; + }; + }; + imports = [ inputs.stylix.nixosModules.stylix ]; - stylix = { - enable = true; - image = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png"; - # image = "${inputs.wallpapers}/aesthetic/red_deadly_sun.jpg"; - # image = "${inputs.wallpapers}/aesthetic/afterglow_sand_dunes.jpg"; - base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml"; - polarity = "dark"; + config = lib.mkIf cfg.enable { + stylix = { + enable = true; + image = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png"; + # image = "${inputs.wallpapers}/aesthetic/red_deadly_sun.jpg"; + # image = "${inputs.wallpapers}/aesthetic/afterglow_sand_dunes.jpg"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml"; + polarity = "dark"; - fonts = { - serif = { - name = "Noto Serif"; - package = pkgs.noto-fonts; + fonts = { + serif = { + name = "Noto Serif"; + package = pkgs.noto-fonts; + }; + sansSerif = { + name = "Noto Sans"; + package = pkgs.noto-fonts; + }; + emoji = { + name = "Noto Color Emoji"; + package = pkgs.noto-fonts-emoji; + }; + monospace = { + name = "CaskaydiaCove Nerd Font"; + package = pkgs.nerd-fonts.caskaydia-cove; + }; }; - sansSerif = { - name = "Noto Sans"; - package = pkgs.noto-fonts; - }; - emoji = { - name = "Noto Color Emoji"; - package = pkgs.noto-fonts-emoji; - }; - monospace = { - name = "CaskaydiaCove Nerd Font"; - package = pkgs.nerd-fonts.caskaydia-cove; + + cursor = { + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Ice"; + size = 26; }; }; - - cursor = { - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Ice"; - size = 26; - }; + assertions = [ + { + assertion = builtins.hasAttr cfg.stylixName inputs; + message = ''You enabled theming but did not add a Stylix module to your flake inputs, or did not set `liminalOS.theming.stylixName` to the name of your Stylix input, if it is not `stylix`. Please set `inputs.stylix.url = "github:danth/stylix"` or set the stylixName option to the name of your stylix flake input.''; + } + ]; }; } diff --git a/modules/linux/wsl/default.nix b/modules/linux/wsl/default.nix index a3ac317..5711d86 100644 --- a/modules/linux/wsl/default.nix +++ b/modules/linux/wsl/default.nix @@ -8,17 +8,17 @@ let cfg = config.liminalOS.wsl; in { - imports = lib.mkIf cfg.enable [ - inputs.nixos-wsl.nixosModules.default + imports = [ + inputs.${cfg.wslName}.nixosModules.default ]; options = { - enable = lib.mkEnableOption "wsl"; - module = lib.mkOption { - type = lib.types.submodule; - default = inputs.nixos-wsl.nixosModules.default; + enable = lib.mkEnableOption "WSL"; + wslName = lib.mkOption { + type = lib.types.str; + default = "nixos-wsl"; description = '' - NixOS WSL module. Defaults to + Name of the NixOS WSL module in your flake inputs. You should define `inputs.nixos-wsl.url = "github:nixos-community/nixos-wsl", and set `liminalOS.wsl.wslName` if you did not call it `nixos-wsl`. ''; }; }; @@ -28,4 +28,10 @@ in defaultUser = config.liminalOS.username; useWindowsDriver = true; }; + assertions = [ + { + assertion = builtins.hasAttr cfg.wslName inputs; + message = ''You enabled WSL but did not add the WSL module to your flake inputs, or did not set `liminalOS.theming.wslName` to the name of your NixOS WSL input, if it is not `nixos-wsl`. Please set `inputs.nixos-wsl.url = "github:nix-community/nixos-wsl"` or set the wslName option to the name of your WSL flake input.''; + } + ]; } From d00dcf035543badeb69aac4466897b870afcd63a Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 22 Dec 2024 23:38:14 -0800 Subject: [PATCH 04/43] refactor: modularize greeter --- hosts/callisto/configuration.nix | 1 + modules/linux/greeter/default.nix | 65 ++++++++++++++++++++++--------- 2 files changed, 47 insertions(+), 19 deletions(-) diff --git a/hosts/callisto/configuration.nix b/hosts/callisto/configuration.nix index 4894167..ac1f300 100755 --- a/hosts/callisto/configuration.nix +++ b/hosts/callisto/configuration.nix @@ -27,6 +27,7 @@ theming = { enable = true; }; + desktop.greeter.enable = true; }; boot = { diff --git a/modules/linux/greeter/default.nix b/modules/linux/greeter/default.nix index 556002c..79aa9f7 100644 --- a/modules/linux/greeter/default.nix +++ b/modules/linux/greeter/default.nix @@ -1,25 +1,52 @@ -{ pkgs, ... }: { - services.greetd = { - enable = true; - settings = { - default_session = { - command = '' - ${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland --remember --greeting "Welcome, generation $(readlink /nix/var/nix/profiles/system | grep -o '[0-9]*'). Access is restricted to authorized personnel only." - ''; - user = "greeter"; - }; + pkgs, + lib, + config, + ... +}: +let + cfg = config.liminalOS.desktop.greeter; +in +{ + options.liminalOS.desktop.greeter = { + enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.desktop.enable; + description = '' + Whether to enable and set up tui-greet, the default greeter for liminalOS. + ''; + }; + command = lib.mkOption { + type = lib.types.str; + default = if config.liminalOS.desktop.enable then "Hyprland" else ""; + description = '' + Command for the greeter to execute to launch the desktop. If the liminalOS Hyprland Desktop is enabled, defaults to `Hyprland`. + ''; }; }; - systemd.services.greetd.serviceConfig = { - Type = "idle"; - StandardInput = "tty"; - StandardOutput = "tty"; - StandardError = "journal"; # Without this errors will spam on screen - # Without these bootlogs will spam on screen - TTYReset = true; - TTYVHangup = true; - TTYVTDisallocate = true; + config = lib.mkIf cfg.enable { + services.greetd = { + enable = true; + settings = { + default_session = { + command = '' + ${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland --remember --greeting "Welcome, generation $(readlink /nix/var/nix/profiles/system | grep -o '[0-9]*'). Access is restricted to authorized personnel only." + ''; + user = "greeter"; + }; + }; + }; + + systemd.services.greetd.serviceConfig = { + Type = "idle"; + StandardInput = "tty"; + StandardOutput = "tty"; + StandardError = "journal"; # Without this errors will spam on screen + # Without these bootlogs will spam on screen + TTYReset = true; + TTYVHangup = true; + TTYVTDisallocate = true; + }; }; } From fe24db3a7f324f95d88883bf0bf09951b50923e7 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 22 Dec 2024 23:43:46 -0800 Subject: [PATCH 05/43] feat: entirely free software --- hosts/callisto/configuration.nix | 4 ++-- users/youwen/common/core.nix | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hosts/callisto/configuration.nix b/hosts/callisto/configuration.nix index ac1f300..a959887 100755 --- a/hosts/callisto/configuration.nix +++ b/hosts/callisto/configuration.nix @@ -145,8 +145,8 @@ KERNEL=="macsmc-battery", SUBSYSTEM=="power_supply", ATTR{charge_control_end_threshold}="90", ATTR{charge_control_start_threshold}="85" ''; - # Allow unfree packages - nixpkgs.config.allowUnfree = true; + # # Allow unfree packages + # nixpkgs.config.allowUnfree = true; # List packages installed in system profile. To search, run: # $ nix search wget diff --git a/users/youwen/common/core.nix b/users/youwen/common/core.nix index 89508d7..7e02d4c 100755 --- a/users/youwen/common/core.nix +++ b/users/youwen/common/core.nix @@ -71,7 +71,6 @@ programs.gh = { enable = true; - extensions = [ pkgs.github-copilot-cli ]; }; programs.starship = { From 6414434a1e860c8b6f945efe0d67a9a55cb44f5c Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 23 Dec 2024 00:35:43 -0800 Subject: [PATCH 06/43] docs: update todos --- TODOS.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/TODOS.md b/TODOS.md index 6ab210f..65a1cb5 100644 --- a/TODOS.md +++ b/TODOS.md @@ -2,15 +2,12 @@ ## P1 +- [ ] Massively refactor module system +- [ ] Disable allowUnfree and atomically control everything using allowUnfreePredicate ## P2 -- Implement custom newtab page - Switch from waybar to eww ## Done -- [x] Add Nvidia-specific config options for Hyprland (blocked by P1) -- [x] Massively refactor module system -- [x] Move wallpapers to submodule -- [x] Move Neovim to submodule From ab0ccf25192b59ade80916f4d5aa3134d33c5425 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 23 Dec 2024 01:18:36 -0800 Subject: [PATCH 07/43] refactor: modularize flatpak and make roblox an option --- modules/linux/flatpak/default.nix | 67 +++++++++++++++----------- modules/linux/flatpak/sober.flatpakref | 10 ++++ modules/linux/gaming/default.nix | 26 ++++++++-- 3 files changed, 71 insertions(+), 32 deletions(-) create mode 100644 modules/linux/flatpak/sober.flatpakref diff --git a/modules/linux/flatpak/default.nix b/modules/linux/flatpak/default.nix index d5d4a34..29d5851 100644 --- a/modules/linux/flatpak/default.nix +++ b/modules/linux/flatpak/default.nix @@ -2,44 +2,53 @@ # versioned. Therefore, they are not included in generational rollbacks and # persist between generations. This is not ideal, but at least it is a better # situation than imperative installation -{ inputs, ... }: +{ + inputs, + config, + lib, + ... +}: +let + cfg = config.liminalOS.programs.flatpaks; +in { imports = [ - inputs.nix-flatpak.nixosModules.nix-flatpak + inputs.${cfg.moduleName}.nixosModules.nix-flatpak ]; - services.flatpak = { - enable = true; + options.liminalOS.programs.flatpaks = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Whether to enable Nix flatpak support with some fixes as well as declarative flatpak management. + ''; + }; + }; - overrides = { - global = { - Context.sockets = [ - "wayland" - "!x11" - "!fallback-x11" - ]; + config = lib.mkIf cfg.enable { + services.flatpak = { + enable = true; - Environment = { - # Fix un-themed cursor in some Wayland apps - XCURSOR_PATH = "/run/host/user-share/icons:/run/host/share/icons"; + overrides = { + global = { + Context.sockets = [ + "wayland" + "!x11" + "!fallback-x11" + ]; + + Environment = { + # Fix un-themed cursor in some Wayland apps + XCURSOR_PATH = "/run/host/user-share/icons:/run/host/share/icons"; + }; }; }; - }; - update.auto = { - enable = true; - onCalendar = "weekly"; + update.auto = { + enable = true; + onCalendar = "weekly"; + }; }; - - packages = [ - { - flatpakref = "https://sober.vinegarhq.org/sober.flatpakref"; - sha256 = "sha256:1pj8y1xhiwgbnhrr3yr3ybpfis9slrl73i0b1lc9q89vhip6ym2l"; - } - { - appId = "org.vinegarhq.Sober"; - origin = "sober"; - } - ]; }; } diff --git a/modules/linux/flatpak/sober.flatpakref b/modules/linux/flatpak/sober.flatpakref new file mode 100644 index 0000000..215f5c3 --- /dev/null +++ b/modules/linux/flatpak/sober.flatpakref @@ -0,0 +1,10 @@ +[Flatpak Ref] +Title=Sober +Name=org.vinegarhq.Sober +Url=https://sober.vinegarhq.org/repo/ +SuggestRemoteName=sober +Homepage=https://sober.vinegarhq.org +Icon=https://sober.vinegarhq.org/sober.svg +RuntimeRepo=https://dl.flathub.org/repo/flathub.flatpakrepo +IsRuntime=false +GPGKey=LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptUUdOQkdhc3U4QUJEQURUQzExYjFmUG9LZU9Ea1hTT3lrYzllajRZeFZMSlZQN2NFZmRnV05aWllsYnFsZ0xECms2MTNxK1dnOE0xb0Zrem00MjMvSUhyT050TEZpVG9sN0paTE1DS0w0d05Id1dnOWpmcmwzak5EUUtKb2lUQVEKZllsWFJiZ09IeVNLYmxFRDVaRm9hQ3BRM0pMQkdaalRUZ1VJck9mK3lSU3lZU09pUHFucEJuM1NHZEh3L0pXegpkY3hRUUd4OVdNL2ZlNGFSVVJMS0k1VG9Ya244cGNZWE4wdE50T2tlOUUzeDI5b3pOcVg0b3BicDJkWXJnejlqCklVM1Zka2VUdTRlSmhJQ2tWMzFVbGpQcVg5VVc1azViTjM4VDRMaEJqQ0kzS1Q2TkJhaXVab1FselFsbXNkYVIKMEdWK3kvSUFhdXNOUzdjMHhCUithUnNnOExpa3h1cXBqWGl6RS9HRTYydCtZeVZBVEs1S0J6aThRZWdVSVMwZgpHRUxkV0RydzBmMUkzc1RuUTBqL2xpZWNneUppMmtmUnlqMThFSmx6WDlYWTdqcHArL2pPUGlqaXYrbXlvaEJXCm1hY3N5UUZCQkg0dEpZUUt4TW1Mc0Y2eUsyWVNTV0IvcS9CZEZlbFY5VDZSWFRlbzRkS0pGK085N0RkRjlTVnYKQWplL25WTjhmZG1VTjgwQUVRRUFBYlFZVTI5aVpYSWdSbXhoZEhCaGF5QlNaWEJ2YzJsMGIzSjVpUUhSQkJNQgpDZ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ybGNveE8vTzkvZ21mZ28vTTFma0xTTmdxN1ZYd0hMV2lSNmFVSjFyOFY5WnRZCmIxbXI4aVIxbGNlR2lRRVFxSTJPMm1KeHptWWlTaHEzZ1dMZjdzaXpnZjk0NFlBVy9rTGUxdVdsSlFpQUcyb0IKa1MzT0RTRUxkdVhFR3NxRGJ2QlQvSVpveGgyMjQ2QzR5MlhiOTZFYUlpYlFxRzJDVTZ3T2xTQktmb09IRTAzegpoQmJSc3dBZlFBPT0KPVp4Q1YKLS0tLS1FTkQgUEdQIFBVQkxJQyBLRVkgQkxPQ0stLS0tLQo= diff --git a/modules/linux/gaming/default.nix b/modules/linux/gaming/default.nix index 2e4493c..133b2b8 100755 --- a/modules/linux/gaming/default.nix +++ b/modules/linux/gaming/default.nix @@ -10,7 +10,14 @@ in { options.liminalOS.extras.gaming = { enable = lib.mkEnableOption "gaming"; - withHamachi = lib.mkEnableOption "hamachi"; + utilities.hamachi.enable = lib.mkEnableOption "hamachi"; + roblox.enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.extras.gaming && cfg.enable; + description = '' + Whether to install the Roblox Sober flatpak automatically. Note that this will enable the nix-flatpak service and automatic flatpak updates.` + ''; + }; }; config = lib.mkIf cfg.enable { environment.systemPackages = with pkgs; [ @@ -21,6 +28,19 @@ in mangojuice ]; + liminalOS.programs.flatpaks.enable = true; + + services.flatpak.packages = lib.mkIf cfg.roblox.enable [ + { + flatpakref = "https://sober.vinegarhq.org/sober.flatpakref"; + sha256 = "sha256:1pj8y1xhiwgbnhrr3yr3ybpfis9slrl73i0b1lc9q89vhip6ym2l"; + } + { + appId = "org.vinegarhq.Sober"; + origin = "sober"; + } + ]; + programs.steam = { enable = true; remotePlay.openFirewall = true; @@ -47,8 +67,8 @@ in users.users.${config.liminalOS.username}.extraGroups = [ "gamemode" ]; - services.logmein-hamachi.enable = cfg.withHamachi; - programs.haguichi.enable = cfg.withHamachi; + services.logmein-hamachi.enable = cfg.utilities.hamachi.enable; + programs.haguichi.enable = cfg.utilities.hamachi.enable; nixpkgs.config.packageOverrides = pkgs: { steam = pkgs.steam.override { From 005fa17ee1c8bc65c4b5f63dd14335c2a808ecd8 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 23 Dec 2024 01:36:18 -0800 Subject: [PATCH 08/43] refactor: change gaming options to be more fine grained --- modules/linux/gaming/default.nix | 153 ++++++++++++++++++------------- 1 file changed, 90 insertions(+), 63 deletions(-) diff --git a/modules/linux/gaming/default.nix b/modules/linux/gaming/default.nix index 133b2b8..e3705a7 100755 --- a/modules/linux/gaming/default.nix +++ b/modules/linux/gaming/default.nix @@ -10,7 +10,19 @@ in { options.liminalOS.extras.gaming = { enable = lib.mkEnableOption "gaming"; - utilities.hamachi.enable = lib.mkEnableOption "hamachi"; + utilities = { + hamachi.enable = lib.mkEnableOption "hamachi"; + gamemode = { + enable = lib.mkEnableOption "gamemode"; + gamemodeUsers = lib.mkOption { + type = lib.types.listOf lib.types.string; + default = [ ]; + description = '' + List of users to add to the gamemode group. Gamemode will likely not work unless you add your user to the group! + ''; + }; + }; + }; roblox.enable = lib.mkOption { type = lib.types.bool; default = config.liminalOS.extras.gaming && cfg.enable; @@ -19,77 +31,92 @@ in ''; }; }; - config = lib.mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - ryujinx - lutris - heroic - mangohud - mangojuice - ]; + config = lib.mkIf cfg.enable ( + let + forAllGamemodeUsers = lib.genAttrs cfg.utilities.gamemode.gamemodeUsers; + in + { + environment.systemPackages = with pkgs; [ + ryujinx + lutris + heroic + mangohud + mangojuice + ]; - liminalOS.programs.flatpaks.enable = true; + liminalOS.programs.flatpaks.enable = true; - services.flatpak.packages = lib.mkIf cfg.roblox.enable [ - { - flatpakref = "https://sober.vinegarhq.org/sober.flatpakref"; - sha256 = "sha256:1pj8y1xhiwgbnhrr3yr3ybpfis9slrl73i0b1lc9q89vhip6ym2l"; - } - { - appId = "org.vinegarhq.Sober"; - origin = "sober"; - } - ]; + services.flatpak.packages = lib.mkIf cfg.roblox.enable [ + { + flatpakref = "https://sober.vinegarhq.org/sober.flatpakref"; + sha256 = "sha256:1pj8y1xhiwgbnhrr3yr3ybpfis9slrl73i0b1lc9q89vhip6ym2l"; + } + { + appId = "org.vinegarhq.Sober"; + origin = "sober"; + } + ]; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - gamescopeSession.enable = true; - }; + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + gamescopeSession.enable = true; + }; - programs.gamescope.enable = true; + programs.gamescope.enable = true; - programs.gamemode = { - enable = true; - enableRenice = true; - settings = { - general = { - renice = 10; - }; - custom = { - start = "${pkgs.libnotify}/bin/notify-send 'GameMode engaged'"; - end = "${pkgs.libnotify}/bin/notify-send 'GameMode disengaged'"; + programs.gamemode = { + enable = true; + enableRenice = true; + settings = { + general = { + renice = 10; + }; + custom = { + start = "${pkgs.libnotify}/bin/notify-send 'GameMode engaged'"; + end = "${pkgs.libnotify}/bin/notify-send 'GameMode disengaged'"; + }; }; }; - }; - users.users.${config.liminalOS.username}.extraGroups = [ "gamemode" ]; + users.users = forAllGamemodeUsers (username: { + ${username}.extraGroups = [ "gamemode" ]; + }); - services.logmein-hamachi.enable = cfg.utilities.hamachi.enable; - programs.haguichi.enable = cfg.utilities.hamachi.enable; + services.logmein-hamachi.enable = cfg.utilities.hamachi.enable; + programs.haguichi.enable = cfg.utilities.hamachi.enable; - nixpkgs.config.packageOverrides = pkgs: { - steam = pkgs.steam.override { - extraPkgs = - pkgs: with pkgs; [ - xorg.libXcursor - xorg.libXi - xorg.libXinerama - xorg.libXScrnSaver - libpng - libpulseaudio - libvorbis - stdenv.cc.cc.lib - libkrb5 - (writeShellScriptBin "launch-gamescope" '' - (sleep 1; pgrep gamescope| xargs renice -n -11 -p)& - exec gamescope "$@" - '') - keyutils - ]; + nixpkgs.config.packageOverrides = pkgs: { + steam = pkgs.steam.override { + extraPkgs = + pkgs: with pkgs; [ + xorg.libXcursor + xorg.libXi + xorg.libXinerama + xorg.libXScrnSaver + libpng + libpulseaudio + libvorbis + stdenv.cc.cc.lib + libkrb5 + (writeShellScriptBin "launch-gamescope" '' + (sleep 1; pgrep gamescope| xargs renice -n -11 -p)& + exec gamescope "$@" + '') + keyutils + ]; + }; }; - }; - }; + + warnings = + if cfg.utilities.gamemode.enable && (builtins.length cfg.utilities.gamemode.gamemodeUsers == 0) then + [ + ''You enabled gamemode without setting any gamemode users in `liminalOS.extras.gaming.utilities.gamemode.gamemodeUsers. Gamemode is unlikely to work unless you add your user to gamemodeUsers.'' + ] + else + [ ]; + } + ); } From 3e93fc2b92711c439013c7a377a5ab8aad734667 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 23 Dec 2024 01:38:04 -0800 Subject: [PATCH 09/43] refactor: modularize distrobox module --- modules/linux/distrobox/default.nix | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/modules/linux/distrobox/default.nix b/modules/linux/distrobox/default.nix index 4b63a5c..0e5b800 100644 --- a/modules/linux/distrobox/default.nix +++ b/modules/linux/distrobox/default.nix @@ -1,9 +1,21 @@ -{ pkgs, ... }: { - virtualisation.podman = { - enable = true; - dockerCompat = true; - }; + pkgs, + lib, + config, + ... +}: +let + cfg = config.liminalOS.extras.distrobox; +in +{ + options.liminalOS.extras.distrobox.enable = lib.mkEnableOption "distrobox and podman"; - environment.systemPackages = [ pkgs.distrobox ]; + config = lib.mkIf cfg.enable { + virtualisation.podman = { + enable = true; + dockerCompat = true; + }; + + environment.systemPackages = [ pkgs.distrobox ]; + }; } From c3fa2197cb58e1b31ed0c7517e91daa4c5450613 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 23 Dec 2024 01:46:52 -0800 Subject: [PATCH 10/43] refactor: modularize hyprland and desktop environment configurations --- hosts/callisto/configuration.nix | 5 +--- hosts/callisto/default.nix | 2 +- modules/linux/desktop-environment/default.nix | 30 +++++++++++++++++++ modules/linux/desktop-portal/default.nix | 7 ----- 4 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 modules/linux/desktop-environment/default.nix delete mode 100644 modules/linux/desktop-portal/default.nix diff --git a/hosts/callisto/configuration.nix b/hosts/callisto/configuration.nix index a959887..b0f7f6e 100755 --- a/hosts/callisto/configuration.nix +++ b/hosts/callisto/configuration.nix @@ -27,7 +27,7 @@ theming = { enable = true; }; - desktop.greeter.enable = true; + desktop.enable = true; }; boot = { @@ -200,9 +200,6 @@ programs.dconf.enable = true; - programs.hyprland.enable = true; - # programs.hyprland.package = inputs.stablepkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}.hyprland; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/hosts/callisto/default.nix b/hosts/callisto/default.nix index 97308b1..b6d3f08 100644 --- a/hosts/callisto/default.nix +++ b/hosts/callisto/default.nix @@ -12,7 +12,7 @@ ../../modules/linux/fonts ../../modules/linux/greeter ../../modules/linux/core - ../../modules/linux/desktop-portal + ../../modules/linux/desktop-environment ../../modules/linux/stylix ../../overlays { diff --git a/modules/linux/desktop-environment/default.nix b/modules/linux/desktop-environment/default.nix new file mode 100644 index 0000000..4ad3246 --- /dev/null +++ b/modules/linux/desktop-environment/default.nix @@ -0,0 +1,30 @@ +{ + pkgs, + lib, + config, + ... +}: +let + cfg = config.liminalOS.desktop; +in +{ + options.liminalOS.desktop = { + enable = lib.mkEnableOption "liminalOS desktop environment with Hyprland and other utilities"; + hyprland.enable = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to enable Hyprland. Sets up a default configuration at the system and user level, and installs xdg-desktop-portal-gtk. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + xdg.portal = lib.mkIf cfg.hyprland.enable { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + + programs.hyprland.enable = cfg.hyprland.enable; + }; +} diff --git a/modules/linux/desktop-portal/default.nix b/modules/linux/desktop-portal/default.nix deleted file mode 100644 index 80d4975..0000000 --- a/modules/linux/desktop-portal/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: -{ - xdg.portal = { - enable = true; - extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; - }; -} From a6224c13c2423f905e6b77a9b2f51e29422eaae0 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 23 Dec 2024 02:09:41 -0800 Subject: [PATCH 11/43] refactor: modularize core --- modules/linux/audio/default.nix | 2 - modules/linux/core/default.nix | 188 +++++++++++++++++++++----------- 2 files changed, 124 insertions(+), 66 deletions(-) diff --git a/modules/linux/audio/default.nix b/modules/linux/audio/default.nix index ddb1a0a..07c728a 100755 --- a/modules/linux/audio/default.nix +++ b/modules/linux/audio/default.nix @@ -14,8 +14,6 @@ in config = { services.playerctld.enable = lib.mkIf cfg.enable true; hardware.pulseaudio.enable = lib.mkIf cfg.enable false; - # TODO: move to other file - security.rtkit.enable = true; services.pipewire = lib.mkIf cfg.enable { enable = true; alsa.enable = true; diff --git a/modules/linux/core/default.nix b/modules/linux/core/default.nix index f5377be..fe4f2eb 100644 --- a/modules/linux/core/default.nix +++ b/modules/linux/core/default.nix @@ -2,80 +2,140 @@ inputs, pkgs, config, + lib, ... }: +let + cfg = config.liminalOS.system.core; +in { - environment.systemPackages = [ - inputs.viminal.packages.${pkgs.system}.default - ]; - - environment.variables = { - EDITOR = "nvim"; + options.liminalOS.system.core = { + enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.enable; + description = '' + Whether to enable core liminalOS system utilities and configurations (such as security policies, Nix options, etc) + ''; + }; + replaceSudoWithDoas = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to replace sudo with doas, the Dedicated OpenBSD Application Subexecutor. Doas is the preferred liminalOS setuid program. + ''; + }; + waylandFixes = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to enable some Wayland fixes, like setting NIXOS_OZONE_WL to hint Electron apps to use the Wayland windowing system. + ''; + }; + nixSaneDefaults = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to set sane defaults for Nix, such as optimization and automatic garbage collection. + ''; + }; + useNh = lib.mkOption { + type = lib.types.bool; + default = cfg.nixSaneDefaults; + description = '' + Whether to enable the `nh` cli (yet another Nix helper), a reimplementation of some core NixOS utilities like nix-collect-garbage and nixos-rebuild. If enabled, automatic garbage collection will use `nh` instead of `nix-collect-garbage` and will be able to garbage collect `result` symlinks. + ''; + }; + flakeLocation = lib.mkOption { + type = lib.types.str; + default = ""; + description = '' + Absolute filepath location of the NixOS system configuration flake. + ''; + }; + suppressWarnings = lib.mkEnableOption "suppress warnings"; }; - # tells electron apps to use Wayland - environment.sessionVariables = { - NIXOS_OZONE_WL = "1"; - }; - - security.sudo.enable = false; - - security.doas = { - enable = true; - extraRules = [ - { - users = [ "youwen" ]; - keepEnv = true; - persist = true; - } + config = lib.mkIf cfg.enable { + environment.systemPackages = [ + inputs.viminal.packages.${pkgs.system}.default ]; - }; - services.gnome.gnome-keyring.enable = true; - - nix = { - optimise.automatic = true; - # gc = { - # automatic = true; - # dates = "weekly"; - # options = "--delete-older-than 14d"; - # }; - # Free up to 1GiB when there is less than 100MiB left - extraOptions = '' - min-free = ${toString (100 * 1024 * 1024)} - max-free = ${toString (1024 * 1024 * 1024)} - ''; - - settings = { - experimental-features = [ - "nix-command" - "flakes" - ]; - substituters = [ - "https://cache.nixos.org" - ]; - trusted-public-keys = [ - "hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=" - ]; + environment.variables = { + EDITOR = "nvim"; }; - channel.enable = false; - }; + # tells electron apps to use Wayland + environment.sessionVariables = lib.mkIf cfg.waylandFixes { + NIXOS_OZONE_WL = "1"; + }; - programs.nh = { - enable = true; - clean.enable = true; - clean.extraArgs = "--keep-since 4d --keep 3"; - flake = "/home/youwen/.config/liminalOS"; - }; - # Enable CUPS to print documents. - services.printing.enable = true; + security = { + sudo.enable = !cfg.replaceSudoWithDoas; - services.avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - }; + doas = lib.mkIf cfg.replaceSudoWithDoas { + enable = true; + extraRules = [ + { + users = [ "youwen" ]; + keepEnv = true; + persist = true; + } + ]; + }; - boot.tmp.cleanOnBoot = true; + rtkit.enable = true; + }; + + services.gnome.gnome-keyring.enable = true; + + nix = lib.mkIf cfg.nixSaneDefaults { + gc = lib.mkIf (!cfg.useNh) { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; + + optimise.automatic = true; + # Free up to 1GiB when there is less than 100MiB left + extraOptions = '' + min-free = ${toString (100 * 1024 * 1024)} + max-free = ${toString (1024 * 1024 * 1024)} + ''; + + settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + substituters = [ + "https://cache.nixos.org" + ]; + trusted-public-keys = [ + "hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=" + ]; + }; + + channel.enable = false; + }; + + programs.nh = lib.mkIf cfg.useNh { + enable = true; + clean = lib.mkIf cfg.nixSaneDefaults { + enable = true; + extraArgs = "--keep-since 4d --keep 3"; + }; + flake = cfg.flakeLocation; + }; + + boot.tmp.cleanOnBoot = true; + + warnings = + if !cfg.suppressWarnings && cfg.useNh && cfg.flakeLocation == "" then + [ + ''The `nh` CLI is enabled but `liminalOS.system.core.flakeLocation` is not set. It is recommended that you set this option so that `nh` can work without specifying the flake path every time. You can disable this warning by setting `liminalOS.system.core.suppressWarnings`.'' + ] + else + [ ]; + + }; } From c9c3e3f6cb81742a8a359cdea90186fc16672df5 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 23 Dec 2024 02:09:52 -0800 Subject: [PATCH 12/43] feat: add printing module --- modules/linux/misc/default.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 modules/linux/misc/default.nix diff --git a/modules/linux/misc/default.nix b/modules/linux/misc/default.nix new file mode 100644 index 0000000..3780248 --- /dev/null +++ b/modules/linux/misc/default.nix @@ -0,0 +1,25 @@ +{ config, lib, ... }: +let + cfg = config.liminalOS.system.printing; +in +{ + options.liminalOS.system.printing = { + enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.enable; + description = '' + Whether to set up default options for printing and printer discover on UNIX. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + services.printing.enable = true; + + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + }; +} From ce89f8149eed4fbe4b197727f65b79a4159032ef Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 23 Dec 2024 02:14:20 -0800 Subject: [PATCH 13/43] refactor: condense some small modules into misc --- modules/linux/default.nix | 3 +-- modules/linux/fonts/default.nix | 31 ------------------------ modules/linux/misc/default.nix | 42 ++++++++++++++++++++++++++++----- 3 files changed, 37 insertions(+), 39 deletions(-) delete mode 100755 modules/linux/fonts/default.nix diff --git a/modules/linux/default.nix b/modules/linux/default.nix index c5df2b9..bd3468d 100644 --- a/modules/linux/default.nix +++ b/modules/linux/default.nix @@ -10,11 +10,10 @@ ./fonts ./gaming ./greeter - ./hamachi ./networking - ./spotifyd ./stylix ./wine ./wsl + ./misc ]; } diff --git a/modules/linux/fonts/default.nix b/modules/linux/fonts/default.nix deleted file mode 100755 index a2b53b6..0000000 --- a/modules/linux/fonts/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: -let - cfg = config.liminalOS.system.fonts; -in -{ - options.liminalOS.system.fonts = { - enable = lib.mkEnableOption "fonts"; - }; - - config = lib.mkIf cfg.enable { - fonts = { - enableDefaultPackages = true; - packages = - with pkgs; - [ - noto-fonts-cjk-sans - (google-fonts.override { fonts = [ "Lora" ]; }) - ] - ++ (lib.optionals (!config.liminalOS.theming.enable) [ - noto-fonts - noto-fonts-emoji - nerd-fonts.caskaydia-cove - ]); - }; - }; -} diff --git a/modules/linux/misc/default.nix b/modules/linux/misc/default.nix index 3780248..c0b03c4 100644 --- a/modules/linux/misc/default.nix +++ b/modules/linux/misc/default.nix @@ -1,25 +1,55 @@ -{ config, lib, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.liminalOS.system.printing; + inherit (lib) mkIf; in { - options.liminalOS.system.printing = { - enable = lib.mkOption { + options.liminalOS.system = { + printing.enable = lib.mkOption { type = lib.types.bool; default = config.liminalOS.enable; description = '' Whether to set up default options for printing and printer discover on UNIX. ''; }; + fonts.enable = lib.mkEnableOption "fonts"; + distrobox.enable = lib.mkEnableOption "distrobox and podman"; }; - config = lib.mkIf cfg.enable { - services.printing.enable = true; + config = { + services.printing.enable = mkIf cfg.printing.enable true; - services.avahi = { + services.avahi = mkIf cfg.printing.enable { enable = true; nssmdns4 = true; openFirewall = true; }; + + fonts = mkIf cfg.fonts.enable { + enableDefaultPackages = true; + packages = + with pkgs; + [ + noto-fonts-cjk-sans + (google-fonts.override { fonts = [ "Lora" ]; }) + ] + ++ (lib.optionals (!config.liminalOS.theming.enable) [ + noto-fonts + noto-fonts-emoji + nerd-fonts.caskaydia-cove + ]); + }; + + virtualisation.podman = cfg.distrobox.enable { + enable = true; + dockerCompat = true; + }; + + environment.systemPackages = cfg.distrobox.enable [ pkgs.distrobox ]; }; } From 180741ec71f7ddc0268fc724d921290521ec0a57 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 23 Dec 2024 04:29:01 -0800 Subject: [PATCH 14/43] fix: reconfigure modules to build successfully on demeter --- hosts/demeter/configuration.nix | 22 ++++++++++++++++++++++ hosts/demeter/default.nix | 13 +------------ modules/default.nix | 7 ------- modules/linux/audio/default.nix | 2 +- modules/linux/core/default.nix | 4 ++-- modules/linux/default.nix | 13 ++++++++++--- modules/linux/flatpak/default.nix | 6 +++--- modules/linux/gaming/default.nix | 6 +++--- modules/linux/misc/default.nix | 14 ++++++++++---- modules/linux/stylix/default.nix | 13 ------------- modules/linux/wsl/default.nix | 17 ++--------------- 11 files changed, 54 insertions(+), 63 deletions(-) diff --git a/hosts/demeter/configuration.nix b/hosts/demeter/configuration.nix index 6267d75..d65d427 100755 --- a/hosts/demeter/configuration.nix +++ b/hosts/demeter/configuration.nix @@ -14,6 +14,28 @@ ./hardware-configuration.nix ]; + liminalOS = { + system = { + audio.prod.enable = true; + networking = { + enable = true; + firewallPresets.vite = true; + cloudflareNameservers.enable = true; + }; + }; + theming.enable = true; + desktop.enable = true; + extras.gaming = { + enable = true; + roblox.enable = true; + utilities.gamemode = { + enable = true; + gamemodeUsers = [ "youwen" ]; + }; + }; + programs.flatpak.enable = true; + }; + # Bootloader. boot.loader = { efi.canTouchEfiVariables = true; diff --git a/hosts/demeter/default.nix b/hosts/demeter/default.nix index 9414274..93b71aa 100644 --- a/hosts/demeter/default.nix +++ b/hosts/demeter/default.nix @@ -6,18 +6,7 @@ imports = [ ./configuration.nix - ../../modules/linux/gaming - ../../modules/linux/audio - ../../modules/linux/networking - ../../modules/linux/fonts - ../../modules/linux/greeter - ../../modules/linux/core - ../../modules/linux/hamachi - ../../modules/linux/desktop-portal - ../../modules/linux/audio-prod - ../../modules/linux/stylix - ../../modules/linux/wine - ../../modules/linux/flatpak + ../../modules/linux ../../overlays { home-manager.useGlobalPkgs = true; diff --git a/modules/default.nix b/modules/default.nix index 7a93bd2..0f342f8 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -12,13 +12,6 @@ in ./linux ]; options.liminalOS = { - linux.enable = lib.mkOption { - type = lib.types.bool; - default = false; - description = '' - Whether to enable liminalOS's default modules and options for Linux. - ''; - }; darwin.enable = lib.mkOption { type = lib.types.bool; default = false; diff --git a/modules/linux/audio/default.nix b/modules/linux/audio/default.nix index 07c728a..a1e1ab6 100755 --- a/modules/linux/audio/default.nix +++ b/modules/linux/audio/default.nix @@ -5,7 +5,7 @@ in { options.liminalOS.system.audio.enable = lib.mkOption { type = lib.types.bool; - default = config.liminalOS.linux.enable; + default = config.liminalOS.enable; description = '' Whether to set up PipeWire and default audio utilities. ''; diff --git a/modules/linux/core/default.nix b/modules/linux/core/default.nix index fe4f2eb..9901df7 100644 --- a/modules/linux/core/default.nix +++ b/modules/linux/core/default.nix @@ -46,8 +46,8 @@ in ''; }; flakeLocation = lib.mkOption { - type = lib.types.str; - default = ""; + type = lib.types.nullOr lib.types.path; + default = null; description = '' Absolute filepath location of the NixOS system configuration flake. ''; diff --git a/modules/linux/default.nix b/modules/linux/default.nix index bd3468d..a98aadc 100644 --- a/modules/linux/default.nix +++ b/modules/linux/default.nix @@ -4,16 +4,23 @@ ./audio ./audio-prod ./core - ./desktop-portal + ./desktop-environment ./distrobox ./flatpak - ./fonts ./gaming ./greeter + ./misc ./networking ./stylix ./wine ./wsl - ./misc ]; + + options.liminalOS.enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to enable liminalOS's default modules and options for Linux. + ''; + }; } diff --git a/modules/linux/flatpak/default.nix b/modules/linux/flatpak/default.nix index 29d5851..417d9f4 100644 --- a/modules/linux/flatpak/default.nix +++ b/modules/linux/flatpak/default.nix @@ -9,14 +9,14 @@ ... }: let - cfg = config.liminalOS.programs.flatpaks; + cfg = config.liminalOS.programs.flatpak; in { imports = [ - inputs.${cfg.moduleName}.nixosModules.nix-flatpak + inputs.nix-flatpak.nixosModules.nix-flatpak ]; - options.liminalOS.programs.flatpaks = { + options.liminalOS.programs.flatpak = { enable = lib.mkOption { type = lib.types.bool; default = false; diff --git a/modules/linux/gaming/default.nix b/modules/linux/gaming/default.nix index e3705a7..8747352 100755 --- a/modules/linux/gaming/default.nix +++ b/modules/linux/gaming/default.nix @@ -15,7 +15,7 @@ in gamemode = { enable = lib.mkEnableOption "gamemode"; gamemodeUsers = lib.mkOption { - type = lib.types.listOf lib.types.string; + type = lib.types.listOf lib.types.str; default = [ ]; description = '' List of users to add to the gamemode group. Gamemode will likely not work unless you add your user to the group! @@ -44,7 +44,7 @@ in mangojuice ]; - liminalOS.programs.flatpaks.enable = true; + liminalOS.programs.flatpak.enable = true; services.flatpak.packages = lib.mkIf cfg.roblox.enable [ { @@ -82,7 +82,7 @@ in }; users.users = forAllGamemodeUsers (username: { - ${username}.extraGroups = [ "gamemode" ]; + extraGroups = [ "gamemode" ]; }); services.logmein-hamachi.enable = cfg.utilities.hamachi.enable; diff --git a/modules/linux/misc/default.nix b/modules/linux/misc/default.nix index c0b03c4..8b9f44c 100644 --- a/modules/linux/misc/default.nix +++ b/modules/linux/misc/default.nix @@ -5,7 +5,7 @@ ... }: let - cfg = config.liminalOS.system.printing; + cfg = config.liminalOS.system; inherit (lib) mkIf; in { @@ -17,7 +17,13 @@ in Whether to set up default options for printing and printer discover on UNIX. ''; }; - fonts.enable = lib.mkEnableOption "fonts"; + fonts.enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.enable; + description = '' + Whether to set up some nice default fonts, including a Nerd Font, Noto Fonts, and CJK. + ''; + }; distrobox.enable = lib.mkEnableOption "distrobox and podman"; }; @@ -45,11 +51,11 @@ in ]); }; - virtualisation.podman = cfg.distrobox.enable { + virtualisation.podman = mkIf cfg.distrobox.enable { enable = true; dockerCompat = true; }; - environment.systemPackages = cfg.distrobox.enable [ pkgs.distrobox ]; + environment.systemPackages = mkIf cfg.distrobox.enable [ pkgs.distrobox ]; }; } diff --git a/modules/linux/stylix/default.nix b/modules/linux/stylix/default.nix index 80dc3ee..3ca67bd 100644 --- a/modules/linux/stylix/default.nix +++ b/modules/linux/stylix/default.nix @@ -11,13 +11,6 @@ in { options.liminalOS.theming = { enable = lib.mkEnableOption "theming"; - stylixName = lib.mkOption { - type = lib.types.str; - default = "stylix"; - description = '' - Name of Stylix module defined in `inputs`. Defaults to `stylix`. You must define `inputs.stylix.url` in your `flake.nix` to enable this option - ''; - }; }; imports = [ @@ -58,11 +51,5 @@ in size = 26; }; }; - assertions = [ - { - assertion = builtins.hasAttr cfg.stylixName inputs; - message = ''You enabled theming but did not add a Stylix module to your flake inputs, or did not set `liminalOS.theming.stylixName` to the name of your Stylix input, if it is not `stylix`. Please set `inputs.stylix.url = "github:danth/stylix"` or set the stylixName option to the name of your stylix flake input.''; - } - ]; }; } diff --git a/modules/linux/wsl/default.nix b/modules/linux/wsl/default.nix index 5711d86..d2f4416 100644 --- a/modules/linux/wsl/default.nix +++ b/modules/linux/wsl/default.nix @@ -9,18 +9,11 @@ let in { imports = [ - inputs.${cfg.wslName}.nixosModules.default + inputs.nixos-wsl.nixosModules.default ]; - options = { + options.liminalOS.wsl = { enable = lib.mkEnableOption "WSL"; - wslName = lib.mkOption { - type = lib.types.str; - default = "nixos-wsl"; - description = '' - Name of the NixOS WSL module in your flake inputs. You should define `inputs.nixos-wsl.url = "github:nixos-community/nixos-wsl", and set `liminalOS.wsl.wslName` if you did not call it `nixos-wsl`. - ''; - }; }; config.wsl = lib.mkIf cfg.enable { @@ -28,10 +21,4 @@ in defaultUser = config.liminalOS.username; useWindowsDriver = true; }; - assertions = [ - { - assertion = builtins.hasAttr cfg.wslName inputs; - message = ''You enabled WSL but did not add the WSL module to your flake inputs, or did not set `liminalOS.theming.wslName` to the name of your NixOS WSL input, if it is not `nixos-wsl`. Please set `inputs.nixos-wsl.url = "github:nix-community/nixos-wsl"` or set the wslName option to the name of your WSL flake input.''; - } - ]; } From 190faacb64445ce2f0442725d5425c4b063cf4e6 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Tue, 24 Dec 2024 18:19:06 -0800 Subject: [PATCH 15/43] feat: atomically track unfree software and enable it --- hosts/demeter/configuration.nix | 25 +++------ modules/linux/audio-prod/default.nix | 4 ++ modules/linux/core/default.nix | 15 ++---- modules/linux/default.nix | 1 + modules/linux/gaming/default.nix | 9 ++++ modules/linux/misc/default.nix | 51 ++++++++++++++----- .../youwen/linux/packages/x86_64/default.nix | 3 -- 7 files changed, 62 insertions(+), 46 deletions(-) diff --git a/hosts/demeter/configuration.nix b/hosts/demeter/configuration.nix index d65d427..59ae003 100755 --- a/hosts/demeter/configuration.nix +++ b/hosts/demeter/configuration.nix @@ -15,6 +15,8 @@ ]; liminalOS = { + flakeLocation = "/home/youwen/.config/liminalOS"; + config.allowUnfree = true; system = { audio.prod.enable = true; networking = { @@ -22,6 +24,10 @@ firewallPresets.vite = true; cloudflareNameservers.enable = true; }; + graphics = { + enable = true; + nvidia.enable = true; + }; }; theming.enable = true; desktop.enable = true; @@ -113,8 +119,6 @@ NetworkManager-wait-online.enable = false; }; - hardware.enableAllFirmware = true; - # Enable the X11 windowing system. # You can disable this if you're only using the Wayland session. services.xserver.enable = false; @@ -128,14 +132,6 @@ ]; }; - hardware.nvidia = { - modesetting.enable = true; - powerManagement.enable = true; - powerManagement.finegrained = false; - open = false; - nvidiaSettings = true; - }; - hardware.bluetooth = { enable = true; powerOnBoot = true; @@ -143,12 +139,6 @@ services.blueman.enable = true; - hardware.graphics.enable = true; - - hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta; - - services.xserver.videoDrivers = [ "nvidia" ]; - # services.desktopManager.plasma6.enable = true; # Configure keymap in X11 @@ -178,9 +168,6 @@ KERNEL=="cpu_dma_latency", GROUP="realtime" ''; - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ diff --git a/modules/linux/audio-prod/default.nix b/modules/linux/audio-prod/default.nix index 3bccf05..6795365 100644 --- a/modules/linux/audio-prod/default.nix +++ b/modules/linux/audio-prod/default.nix @@ -21,5 +21,9 @@ in yabridge yabridgectl ]; + + liminalOS.config.extraUnfreePackages = lib.mkIf config.liminalOS.config.allowUnfree [ + "reaper" + ]; }; } diff --git a/modules/linux/core/default.nix b/modules/linux/core/default.nix index 9901df7..e405f94 100644 --- a/modules/linux/core/default.nix +++ b/modules/linux/core/default.nix @@ -45,13 +45,6 @@ in Whether to enable the `nh` cli (yet another Nix helper), a reimplementation of some core NixOS utilities like nix-collect-garbage and nixos-rebuild. If enabled, automatic garbage collection will use `nh` instead of `nix-collect-garbage` and will be able to garbage collect `result` symlinks. ''; }; - flakeLocation = lib.mkOption { - type = lib.types.nullOr lib.types.path; - default = null; - description = '' - Absolute filepath location of the NixOS system configuration flake. - ''; - }; suppressWarnings = lib.mkEnableOption "suppress warnings"; }; @@ -124,15 +117,17 @@ in enable = true; extraArgs = "--keep-since 4d --keep 3"; }; - flake = cfg.flakeLocation; + flake = config.liminalOS.flakeLocation; }; boot.tmp.cleanOnBoot = true; + hardware.enableRedistributableFirmware = true; + warnings = - if !cfg.suppressWarnings && cfg.useNh && cfg.flakeLocation == "" then + if !cfg.suppressWarnings && cfg.useNh && config.liminalOS.flakeLocation == "" then [ - ''The `nh` CLI is enabled but `liminalOS.system.core.flakeLocation` is not set. It is recommended that you set this option so that `nh` can work without specifying the flake path every time. You can disable this warning by setting `liminalOS.system.core.suppressWarnings`.'' + ''The `nh` CLI is enabled but `liminalOS.flakeLocation` is not set. It is recommended that you set this option to the absolute file path of your configuration flake so that `nh` can work without specifying the flake path every time. You can disable this warning by setting `liminalOS.system.core.suppressWarnings`.'' ] else [ ]; diff --git a/modules/linux/default.nix b/modules/linux/default.nix index a98aadc..9a4067a 100644 --- a/modules/linux/default.nix +++ b/modules/linux/default.nix @@ -14,6 +14,7 @@ ./stylix ./wine ./wsl + ./graphics ]; options.liminalOS.enable = lib.mkOption { diff --git a/modules/linux/gaming/default.nix b/modules/linux/gaming/default.nix index 8747352..d1d152b 100755 --- a/modules/linux/gaming/default.nix +++ b/modules/linux/gaming/default.nix @@ -42,6 +42,8 @@ in heroic mangohud mangojuice + r2modman + modrinth-app ]; liminalOS.programs.flatpak.enable = true; @@ -81,6 +83,13 @@ in }; }; + liminalOS.config.extraUnfreePackages = lib.mkIf config.liminalOS.config.allowUnfree [ + "modrinth-app" + "modrinth-app-unwrapped" + "steam" + "steam-unwrapped" + ]; + users.users = forAllGamemodeUsers (username: { extraGroups = [ "gamemode" ]; }); diff --git a/modules/linux/misc/default.nix b/modules/linux/misc/default.nix index 8b9f44c..c93a66c 100644 --- a/modules/linux/misc/default.nix +++ b/modules/linux/misc/default.nix @@ -5,38 +5,58 @@ ... }: let - cfg = config.liminalOS.system; + cfg = config.liminalOS; inherit (lib) mkIf; in { - options.liminalOS.system = { - printing.enable = lib.mkOption { + options.liminalOS = { + system.printing.enable = lib.mkOption { type = lib.types.bool; default = config.liminalOS.enable; description = '' Whether to set up default options for printing and printer discover on UNIX. ''; }; - fonts.enable = lib.mkOption { + system.fonts.enable = lib.mkOption { type = lib.types.bool; default = config.liminalOS.enable; description = '' Whether to set up some nice default fonts, including a Nerd Font, Noto Fonts, and CJK. ''; }; - distrobox.enable = lib.mkEnableOption "distrobox and podman"; + config.allowUnfree = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Whether to enable some proprietary packages required by certain liminalOS modules. This does not set allowUnfree for the whole system, it merely allows the installation of a few proprietary packages such as Nvidia drivers, etc. You should still set this option even if you already set nixpkgs.config.allowUnfree for the whole system since it tells liminalOS it can enable certain options that require proprietary packages. + ''; + }; + config.extraUnfreePackages = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + description = '' + Packages to enable in allowUnfreePredicate + ''; + }; + flakeLocation = lib.mkOption { + type = lib.types.nullOr lib.types.path; + default = null; + description = '' + Absolute filepath location of the NixOS system configuration flake. + ''; + }; }; config = { - services.printing.enable = mkIf cfg.printing.enable true; + services.printing.enable = mkIf cfg.system.printing.enable true; - services.avahi = mkIf cfg.printing.enable { + services.avahi = mkIf cfg.system.printing.enable { enable = true; nssmdns4 = true; openFirewall = true; }; - fonts = mkIf cfg.fonts.enable { + fonts = mkIf cfg.system.fonts.enable { enableDefaultPackages = true; packages = with pkgs; @@ -51,11 +71,14 @@ in ]); }; - virtualisation.podman = mkIf cfg.distrobox.enable { - enable = true; - dockerCompat = true; - }; - - environment.systemPackages = mkIf cfg.distrobox.enable [ pkgs.distrobox ]; + nixpkgs.config.allowUnfreePredicate = lib.mkIf config.liminalOS.config.allowUnfree ( + pkg: + builtins.elem (pkgs.lib.getName pkg) ( + config.liminalOS.config.extraUnfreePackages + ++ [ + "spotify" + ] + ) + ); }; } diff --git a/users/youwen/linux/packages/x86_64/default.nix b/users/youwen/linux/packages/x86_64/default.nix index 035e094..5be5436 100644 --- a/users/youwen/linux/packages/x86_64/default.nix +++ b/users/youwen/linux/packages/x86_64/default.nix @@ -11,10 +11,7 @@ in (createCommon pkgs) ++ (with pkgs; [ bitwarden-desktop - modrinth-app sbctl - r2modman - zoom-us ]); home.sessionVariables = { From 104a61a05511d813ace040496268016cc97c88f7 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Tue, 24 Dec 2024 18:19:54 -0800 Subject: [PATCH 16/43] feat: manage nvidia graphics as a module --- modules/linux/graphics/default.nix | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 modules/linux/graphics/default.nix diff --git a/modules/linux/graphics/default.nix b/modules/linux/graphics/default.nix new file mode 100644 index 0000000..2b7aa74 --- /dev/null +++ b/modules/linux/graphics/default.nix @@ -0,0 +1,51 @@ +{ + lib, + config, + pkgs, + ... +}: +let + cfg = config.liminalOS.system.graphics; +in +{ + options.liminalOS.system.graphics = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to set up basic graphics settings and options. + ''; + }; + nvidia = { + enable = lib.mkEnableOption "recommended nvidia drivers and configuration"; + optimus-prime.enable = lib.mkEnableOption "Nvidia OPTIMUS and PRIME"; + optimus-prime.powerMode = lib.mkOption { + type = lib.types.enum [ + "powersaving" + "performance" + ]; + default = "performance"; + description = '' + Whether to use Nvidia OPTIMUS with maximum performance using the discrete graphics card, or to use offload mode to primarily use the integrated GPU and save power. + ''; + }; + suppressUnfreeWarning = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Whether to disable the assertion that warns the user if they try to enable proprietary nvidia drivers without setting allowUnfree. + ''; + }; + }; + }; + + config = lib.mkIf cfg.enable { + hardware.nvidia = lib.mkIf cfg.nvidia.enable { + modesetting.enable = true; + powerManagement.enable = true; + powerManagement.finegrained = false; + open = true; + package = config.boot.kernelPackages.nvidiaPackages.beta; + }; + }; +} From 1aa376e94f7f4070a6f2aeb12401f91f35b00b8c Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Tue, 24 Dec 2024 18:47:17 -0800 Subject: [PATCH 17/43] refactor: configure more core system options via liminalOS module --- hosts/demeter/configuration.nix | 146 ++++-------------- modules/linux/core/default.nix | 64 +++++++- modules/linux/desktop-environment/default.nix | 7 + modules/linux/misc/default.nix | 22 +++ modules/linux/stylix/default.nix | 28 ++++ 5 files changed, 144 insertions(+), 123 deletions(-) diff --git a/hosts/demeter/configuration.nix b/hosts/demeter/configuration.nix index 59ae003..cb24d82 100755 --- a/hosts/demeter/configuration.nix +++ b/hosts/demeter/configuration.nix @@ -14,6 +14,8 @@ ./hardware-configuration.nix ]; + networking.hostName = "demeter"; # Define your hostname. + liminalOS = { flakeLocation = "/home/youwen/.config/liminalOS"; config.allowUnfree = true; @@ -42,87 +44,35 @@ programs.flatpak.enable = true; }; - # Bootloader. - boot.loader = { - efi.canTouchEfiVariables = true; - timeout = 15; - # Lanzaboote currently replaces the systemd-boot module. - # This setting is usually set to true in configuration.nix - # generated at installation time. So we force it to false - # for now. - systemd-boot = { - enable = false; - consoleMode = "auto"; - }; - }; - - boot = { - plymouth = { - enable = true; - font = "${config.stylix.fonts.monospace.package}/share/fonts/truetype/NerdFonts/CaskaydiaCove/CaskaydiaCoveNerdFontMono-Regular.ttf"; - }; - - # Enable "Silent Boot" - consoleLogLevel = 3; - initrd.verbose = false; - kernelParams = [ - "quiet" - "splash" - "boot.shell_on_fail" - "rd.systemd.show_status=false" - "rd.udev.log_level=3" - "udev.log_priority=3" - ]; - initrd.systemd.enable = true; - }; - - boot.lanzaboote = { - enable = true; - pkiBundle = "/etc/secureboot"; - }; - - boot.initrd.luks.devices."luks-af320a0f-b388-43f5-b5a3-af2b47cfc716".device = - "/dev/disk/by-uuid/af320a0f-b388-43f5-b5a3-af2b47cfc716"; - - networking.hostName = "demeter"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # select kernel - boot.kernelPackages = pkgs.linuxPackages_zen; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. time.timeZone = "America/Los_Angeles"; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; + hardware.cpu.intel.updateMicrocode = true; - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; + # Bootloader. + boot = { + loader = { + efi.canTouchEfiVariables = true; + timeout = 15; + # Lanzaboote currently replaces the systemd-boot module. + # This setting is usually set to true in configuration.nix + # generated at installation time. So we force it to false + # for now. + systemd-boot = { + enable = false; + consoleMode = "auto"; + }; + }; + lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + }; + + kernelPackages = pkgs.linuxPackages_zen; + + initrd.luks.devices."luks-af320a0f-b388-43f5-b5a3-af2b47cfc716".device = + "/dev/disk/by-uuid/af320a0f-b388-43f5-b5a3-af2b47cfc716"; }; - systemd.services = { - NetworkManager-wait-online.enable = false; - }; - - # Enable the X11 windowing system. - # You can disable this if you're only using the Wayland session. - services.xserver.enable = false; - programs.nix-ld = { enable = true; libraries = with pkgs; [ @@ -132,24 +82,6 @@ ]; }; - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - - services.blueman.enable = true; - - # services.desktopManager.plasma6.enable = true; - - # Configure keymap in X11 - services.xserver = { - xkb.layout = "us"; - xkb.variant = ""; - }; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.youwen = { isNormalUser = true; @@ -164,32 +96,6 @@ ]; }; - services.udev.extraRules = '' - KERNEL=="cpu_dma_latency", GROUP="realtime" - ''; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - wget - git - curl - ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - programs.dconf.enable = true; - - programs.hyprland.enable = true; - - hardware.cpu.intel.updateMicrocode = true; - programs.zsh.enable = false; programs.fish.enable = true; users.users.youwen.shell = pkgs.fish; diff --git a/modules/linux/core/default.nix b/modules/linux/core/default.nix index e405f94..0991dba 100644 --- a/modules/linux/core/default.nix +++ b/modules/linux/core/default.nix @@ -46,12 +46,43 @@ in ''; }; suppressWarnings = lib.mkEnableOption "suppress warnings"; + networking = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = ''Whether to set up and enable networking daemons.''; + }; + backend = lib.mkOption { + type = lib.types.enum [ + "wpa_supplicant" + "iwd" + ]; + default = "wpa_supplicant"; + description = '' + Which backend to use for networking. Default is wpa_supplicant with NetworkManager as a frontend. With iwd, iwctl is the frontend. + ''; + }; + }; + bluetooth.enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to enable bluetooth and blueman. + ''; + }; }; config = lib.mkIf cfg.enable { - environment.systemPackages = [ - inputs.viminal.packages.${pkgs.system}.default - ]; + environment.systemPackages = + with pkgs; + [ + wget + git + curl + ] + ++ [ + inputs.viminal.packages.${pkgs.system}.default + ]; environment.variables = { EDITOR = "nvim"; @@ -124,6 +155,33 @@ in hardware.enableRedistributableFirmware = true; + networking.networkmanager.enable = lib.mkIf ( + cfg.networking.enable && cfg.networking.backend == "wpa_supplicant" + ) true; + + systemd.services.NetworkManager-wait-online.enable = lib.mkIf ( + cfg.networking.enable && cfg.networking.backend == "wpa_supplicant" + ) false; + + networking.wireless.iwd = lib.mkIf (cfg.networking.enable && cfg.networking.backend == "iwd") { + enable = true; + settings.General.EnableNetworkConfiguration = true; + }; + + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + programs.dconf.enable = true; + + hardware.bluetooth = lib.mkIf cfg.bluetooth.enable { + enable = true; + powerOnBoot = true; + }; + + services.blueman.enable = lib.mkIf cfg.bluetooth.enable true; + warnings = if !cfg.suppressWarnings && cfg.useNh && config.liminalOS.flakeLocation == "" then [ diff --git a/modules/linux/desktop-environment/default.nix b/modules/linux/desktop-environment/default.nix index 4ad3246..734506a 100644 --- a/modules/linux/desktop-environment/default.nix +++ b/modules/linux/desktop-environment/default.nix @@ -26,5 +26,12 @@ in }; programs.hyprland.enable = cfg.hyprland.enable; + + services.xserver.enable = false; + + services.xserver = { + xkb.layout = "us"; + xkb.variant = ""; + }; }; } diff --git a/modules/linux/misc/default.nix b/modules/linux/misc/default.nix index c93a66c..a7c378e 100644 --- a/modules/linux/misc/default.nix +++ b/modules/linux/misc/default.nix @@ -45,6 +45,11 @@ in Absolute filepath location of the NixOS system configuration flake. ''; }; + useEnUsLocale = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Whether to use the en_US locale automatically"; + }; }; config = { @@ -80,5 +85,22 @@ in ] ) ); + + # Select internationalisation properties. + i18n = lib.mkIf cfg.useEnUsLocale { + defaultLocale = "en_US.UTF-8"; + + extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + }; }; } diff --git a/modules/linux/stylix/default.nix b/modules/linux/stylix/default.nix index 3ca67bd..cc46bfb 100644 --- a/modules/linux/stylix/default.nix +++ b/modules/linux/stylix/default.nix @@ -11,6 +11,13 @@ in { options.liminalOS.theming = { enable = lib.mkEnableOption "theming"; + plymouth.enable = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to enable plymouth and sane defaults. + ''; + }; }; imports = [ @@ -51,5 +58,26 @@ in size = 26; }; }; + + boot = { + plymouth = { + enable = true; + font = "${config.stylix.fonts.monospace.package}/share/fonts/truetype/NerdFonts/CaskaydiaCove/CaskaydiaCoveNerdFontMono-Regular.ttf"; + }; + + # Enable "Silent Boot" + consoleLogLevel = 3; + initrd.verbose = false; + kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.log_priority=3" + ]; + initrd.systemd.enable = true; + }; + }; } From f4ce8e31b45db59db9828135ebac3d7498488639 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Tue, 24 Dec 2024 20:23:58 -0800 Subject: [PATCH 18/43] chore: remove some unneeded options in callisto --- hosts/callisto/configuration.nix | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/hosts/callisto/configuration.nix b/hosts/callisto/configuration.nix index b0f7f6e..f94980b 100755 --- a/hosts/callisto/configuration.nix +++ b/hosts/callisto/configuration.nix @@ -68,14 +68,10 @@ settings.General.EnableNetworkConfiguration = true; }; - nixpkgs.overlays = - let - stablepkgs = inputs.stablepkgs.legacyPackages.${pkgs.system}; - in - [ - inputs.apple-silicon.overlays.apple-silicon-overlay - inputs.vesktop-bin.overlays.default - ]; + nixpkgs.overlays = [ + inputs.apple-silicon.overlays.apple-silicon-overlay + inputs.vesktop-bin.overlays.default + ]; programs.light.enable = true; @@ -150,11 +146,6 @@ # List packages installed in system profile. To search, run: # $ nix search wget - environment.systemPackages = with pkgs; [ - wget - git - curl - ]; services.keyd = { enable = true; From f889514d7dc63d24b0f372a539e7114937f95206 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Tue, 24 Dec 2024 20:54:49 -0800 Subject: [PATCH 19/43] fix: correctly install proprietary nvidia drivers --- modules/linux/graphics/default.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/linux/graphics/default.nix b/modules/linux/graphics/default.nix index 2b7aa74..d83f1b5 100644 --- a/modules/linux/graphics/default.nix +++ b/modules/linux/graphics/default.nix @@ -46,6 +46,24 @@ in powerManagement.finegrained = false; open = true; package = config.boot.kernelPackages.nvidiaPackages.beta; + nvidiaSettings = true; }; + + services.xserver.videoDrivers = lib.mkIf cfg.nvidia.enable [ "nvidia" ]; + + liminalOS.config.extraUnfreePackages = lib.mkIf cfg.nvidia.enable [ + "nvidia-x11" + "nvidia-settings" + ]; + + assertions = [ + { + assertion = + !cfg.nvidia.enable + || (config.liminalOS.config.allowUnfree && cfg.nvidia.enable) + || cfg.nvidia.suppressUnfreeWarning; + message = "You enabled Nvidia proprietary driver installation but did not allow unfree packages to be installed! Consider setting liminalOS.config.allowUnfree = true or nixpkgs.config.allowUnfree = true. If you are using an allowUnfreePredicate to whitelist these packages manually, you can set liminalOS.system.graphics.nvidia.suppressUnfreeWarning = true"; + } + ]; }; } From 2823e5284ec989b0fadb9aec7e0af0c61310fa19 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Tue, 24 Dec 2024 20:55:07 -0800 Subject: [PATCH 20/43] feat: add default editor option and configuration --- hosts/demeter/configuration.nix | 1 + modules/linux/core/default.nix | 4 ---- modules/linux/misc/default.nix | 11 +++++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hosts/demeter/configuration.nix b/hosts/demeter/configuration.nix index cb24d82..7c2e507 100755 --- a/hosts/demeter/configuration.nix +++ b/hosts/demeter/configuration.nix @@ -19,6 +19,7 @@ liminalOS = { flakeLocation = "/home/youwen/.config/liminalOS"; config.allowUnfree = true; + defaultEditor = inputs.viminal.packages.${pkgs.system}.default; system = { audio.prod.enable = true; networking = { diff --git a/modules/linux/core/default.nix b/modules/linux/core/default.nix index 0991dba..4c8604e 100644 --- a/modules/linux/core/default.nix +++ b/modules/linux/core/default.nix @@ -84,10 +84,6 @@ in inputs.viminal.packages.${pkgs.system}.default ]; - environment.variables = { - EDITOR = "nvim"; - }; - # tells electron apps to use Wayland environment.sessionVariables = lib.mkIf cfg.waylandFixes { NIXOS_OZONE_WL = "1"; diff --git a/modules/linux/misc/default.nix b/modules/linux/misc/default.nix index a7c378e..7e93c75 100644 --- a/modules/linux/misc/default.nix +++ b/modules/linux/misc/default.nix @@ -50,6 +50,11 @@ in default = true; description = "Whether to use the en_US locale automatically"; }; + defaultEditor = lib.mkOption { + type = lib.types.nullOr lib.types.package; + default = pkgs.neovim; + description = "Default text editor that will be installed and set as $EDITOR. Set to null to disable setting and installing default text editor."; + }; }; config = { @@ -86,6 +91,12 @@ in ) ); + environment.variables.EDITOR = lib.mkIf ( + cfg.defaultEditor != null + ) cfg.defaultEditor.meta.mainProgram; + + environment.systemPackages = lib.mkIf (cfg.defaultEditor != null) [ cfg.defaultEditor ]; + # Select internationalisation properties. i18n = lib.mkIf cfg.useEnUsLocale { defaultLocale = "en_US.UTF-8"; From d48dd3be2e41fb6811fec925d11af6aaaabe19e2 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 17:19:28 -0800 Subject: [PATCH 21/43] feat: add some core functionality that is required for system function --- modules/linux/core/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/linux/core/default.nix b/modules/linux/core/default.nix index 4c8604e..cc88d2a 100644 --- a/modules/linux/core/default.nix +++ b/modules/linux/core/default.nix @@ -133,6 +133,7 @@ in trusted-public-keys = [ "hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=" ]; + trusted-users = [ "@wheel" ]; }; channel.enable = false; @@ -147,6 +148,15 @@ in flake = config.liminalOS.flakeLocation; }; + programs.nix-ld = { + enable = true; + libraries = with pkgs; [ + icu + xorg.libXtst + xorg.libXi + ]; + }; + boot.tmp.cleanOnBoot = true; hardware.enableRedistributableFirmware = true; @@ -171,6 +181,8 @@ in programs.dconf.enable = true; + programs.fish.enable = true; + hardware.bluetooth = lib.mkIf cfg.bluetooth.enable { enable = true; powerOnBoot = true; From a0bc16e20c003bba947ec1185d6d6da4478a77ac Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 17:19:42 -0800 Subject: [PATCH 22/43] docs: update todo --- TODOS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TODOS.md b/TODOS.md index 65a1cb5..fc719ad 100644 --- a/TODOS.md +++ b/TODOS.md @@ -3,7 +3,8 @@ ## P1 - [ ] Massively refactor module system -- [ ] Disable allowUnfree and atomically control everything using allowUnfreePredicate +- [x] Disable allowUnfree and atomically control everything using allowUnfreePredicate +- [ ] Decide what to do with easyeffects ## P2 From b2270408fca600c0b96d573d46cf0ea8c663159c Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 17:19:51 -0800 Subject: [PATCH 23/43] chore: remove unneeded configuration from demeter that now lives in core --- hosts/demeter/configuration.nix | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/hosts/demeter/configuration.nix b/hosts/demeter/configuration.nix index 7c2e507..7183610 100755 --- a/hosts/demeter/configuration.nix +++ b/hosts/demeter/configuration.nix @@ -74,32 +74,16 @@ "/dev/disk/by-uuid/af320a0f-b388-43f5-b5a3-af2b47cfc716"; }; - programs.nix-ld = { - enable = true; - libraries = with pkgs; [ - icu - xorg.libXtst - xorg.libXi - ]; - }; - - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.youwen = { isNormalUser = true; description = "Youwen Wu"; - extraGroups = [ "networkmanager" ]; - }; - - nix.settings = { - trusted-users = [ - "root" - "youwen" + extraGroups = [ + "networkmanager" + "wheel" ]; + shell = pkgs.fish; }; - programs.zsh.enable = false; - programs.fish.enable = true; - users.users.youwen.shell = pkgs.fish; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave From a506d2aed45dce6ef852d437c87c7439b4b8ae71 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 19:47:59 -0800 Subject: [PATCH 24/43] refactor: massively overhaul home manager module system --- flake.nix | 28 +- hm/default.nix | 29 + hm/modules/common/default.nix | 10 + hm/modules/common/essentials/README.md | 1 + hm/modules/common/essentials/tabliss.json | 1 + .../common/essentials/vencord-settings.json | 617 ++++++++++++++++++ hm/modules/common/shellenv/default.nix | 212 ++++++ .../common/shellenv/fastfetch/config.json | 81 +++ .../common/shellenv/fastfetch/default.nix | 39 ++ .../common/shellenv/fastfetch/nixos-logo.png | Bin 0 -> 28684 bytes hm/modules/common/shellenv/jetpack.toml | 315 +++++++++ hm/modules/darwin/darwin-home.nix | 81 +++ hm/modules/default.nix | 6 + hm/modules/linux/default.nix | 45 ++ .../linux/desktop-environment/default.nix | 23 + .../desktop-environment/hyprland/default.nix | 394 +++++++++++ .../hyprland/windowrulev2.nix | 86 +++ .../linux/desktop-environment/swaync.nix | 325 +++++++++ .../desktop-environment/waybar/default.nix | 208 ++++++ .../waybar/desktop/default.nix | 171 +++++ .../waybar/desktop/style.css | 71 ++ .../desktop-environment/waybar/style.css | 78 +++ hm/modules/linux/platform-tweaks/default.nix | 35 + hm/modules/linux/programs/bulk-programs.nix | 88 +++ hm/modules/linux/programs/default.nix | 95 +++ hm/modules/linux/spicetify/default.nix | 31 + hm/modules/linux/theming/default.nix | 14 + hm/modules/linux/theming/stylix.nix | 13 + hm/modules/linux/var/easyeffects/default.nix | 35 + .../linux/var/easyeffects/input/Default.json | 75 +++ .../linux/var/easyeffects/input/Studio.json | 75 +++ .../easyeffects/output/AirPods Pro ANC.json | 243 +++++++ .../output/AirPods Pro Transparency.json | 243 +++++++ .../var/easyeffects/output/Arctis Pro EQ.json | 243 +++++++ .../var/easyeffects/output/DT770 Pro.json | 243 +++++++ .../linux/var/easyeffects/output/Default.json | 243 +++++++ hm/modules/linux/var/settings.json | 611 +++++++++++++++++ hosts/demeter/default.nix | 39 -- modules/linux/audio/default.nix | 1 + modules/linux/desktop-environment/default.nix | 8 +- modules/linux/flatpak/default.nix | 1 + modules/linux/misc/default.nix | 23 +- modules/linux/networking/default.nix | 8 +- modules/linux/stylix/default.nix | 8 +- .../hosts}/adrastea/configuration.nix | 0 .../hosts}/adrastea/default.nix | 0 .../adrastea/hardware-configuration.nix | 0 .../adrastea/home-manager-extras/default.nix | 0 .../hosts}/callisto/configuration.nix | 0 .../hosts}/callisto/default.nix | 0 .../callisto/hardware-configuration.nix | 0 .../callisto/home-manager-extras/default.nix | 0 .../home-manager-extras/neofetch-asahi.conf | 0 .../hosts}/cassini/configuration.nix | 0 .../hosts}/cassini/default.nix | 0 .../hosts}/cassini/hardware-configuration.nix | 0 .../cassini/home-manager-extras/default.nix | 0 .../hosts}/demeter/configuration.nix | 12 +- reference/hosts/demeter/default.nix | 21 + .../hosts}/demeter/hardware-configuration.nix | 0 .../hosts/demeter/home.nix | 13 +- .../hosts}/phobos/configuration.nix | 0 {hosts => reference/hosts}/phobos/default.nix | 0 reference/users/youwen/default.nix | 23 + 64 files changed, 5201 insertions(+), 64 deletions(-) create mode 100644 hm/default.nix create mode 100644 hm/modules/common/default.nix create mode 100644 hm/modules/common/essentials/README.md create mode 100644 hm/modules/common/essentials/tabliss.json create mode 100644 hm/modules/common/essentials/vencord-settings.json create mode 100644 hm/modules/common/shellenv/default.nix create mode 100644 hm/modules/common/shellenv/fastfetch/config.json create mode 100644 hm/modules/common/shellenv/fastfetch/default.nix create mode 100644 hm/modules/common/shellenv/fastfetch/nixos-logo.png create mode 100644 hm/modules/common/shellenv/jetpack.toml create mode 100755 hm/modules/darwin/darwin-home.nix create mode 100644 hm/modules/default.nix create mode 100755 hm/modules/linux/default.nix create mode 100644 hm/modules/linux/desktop-environment/default.nix create mode 100644 hm/modules/linux/desktop-environment/hyprland/default.nix create mode 100644 hm/modules/linux/desktop-environment/hyprland/windowrulev2.nix create mode 100644 hm/modules/linux/desktop-environment/swaync.nix create mode 100644 hm/modules/linux/desktop-environment/waybar/default.nix create mode 100644 hm/modules/linux/desktop-environment/waybar/desktop/default.nix create mode 100644 hm/modules/linux/desktop-environment/waybar/desktop/style.css create mode 100644 hm/modules/linux/desktop-environment/waybar/style.css create mode 100644 hm/modules/linux/platform-tweaks/default.nix create mode 100644 hm/modules/linux/programs/bulk-programs.nix create mode 100644 hm/modules/linux/programs/default.nix create mode 100644 hm/modules/linux/spicetify/default.nix create mode 100644 hm/modules/linux/theming/default.nix create mode 100644 hm/modules/linux/theming/stylix.nix create mode 100644 hm/modules/linux/var/easyeffects/default.nix create mode 100644 hm/modules/linux/var/easyeffects/input/Default.json create mode 100644 hm/modules/linux/var/easyeffects/input/Studio.json create mode 100644 hm/modules/linux/var/easyeffects/output/AirPods Pro ANC.json create mode 100644 hm/modules/linux/var/easyeffects/output/AirPods Pro Transparency.json create mode 100644 hm/modules/linux/var/easyeffects/output/Arctis Pro EQ.json create mode 100644 hm/modules/linux/var/easyeffects/output/DT770 Pro.json create mode 100644 hm/modules/linux/var/easyeffects/output/Default.json create mode 100644 hm/modules/linux/var/settings.json delete mode 100644 hosts/demeter/default.nix rename {hosts => reference/hosts}/adrastea/configuration.nix (100%) rename {hosts => reference/hosts}/adrastea/default.nix (100%) rename {hosts => reference/hosts}/adrastea/hardware-configuration.nix (100%) rename {hosts => reference/hosts}/adrastea/home-manager-extras/default.nix (100%) rename {hosts => reference/hosts}/callisto/configuration.nix (100%) rename {hosts => reference/hosts}/callisto/default.nix (100%) rename {hosts => reference/hosts}/callisto/hardware-configuration.nix (100%) rename {hosts => reference/hosts}/callisto/home-manager-extras/default.nix (100%) rename {hosts => reference/hosts}/callisto/home-manager-extras/neofetch-asahi.conf (100%) rename {hosts => reference/hosts}/cassini/configuration.nix (100%) rename {hosts => reference/hosts}/cassini/default.nix (100%) rename {hosts => reference/hosts}/cassini/hardware-configuration.nix (100%) rename {hosts => reference/hosts}/cassini/home-manager-extras/default.nix (100%) rename {hosts => reference/hosts}/demeter/configuration.nix (91%) create mode 100644 reference/hosts/demeter/default.nix rename {hosts => reference/hosts}/demeter/hardware-configuration.nix (100%) rename hosts/demeter/home-manager-extras/default.nix => reference/hosts/demeter/home.nix (64%) rename {hosts => reference/hosts}/phobos/configuration.nix (100%) rename {hosts => reference/hosts}/phobos/default.nix (100%) create mode 100644 reference/users/youwen/default.nix diff --git a/flake.nix b/flake.nix index 0599a79..977e6c4 100755 --- a/flake.nix +++ b/flake.nix @@ -115,25 +115,26 @@ systems = [ "x86_64-linux" "aarch64-linux" - "aarch64-darwin" + # "aarch64-darwin" + # aarch64-darwin is currently disabled due to lack of maintenance ]; flake = { nixosConfigurations = { demeter = buildLiminalOS { inherit inputs nixpkgs; - systemModule = ./hosts/demeter; + systemModule = ./reference/hosts/demeter; }; callisto = buildLiminalOS { inherit nixpkgs inputs; - systemModule = ./hosts/callisto; + systemModule = ./reference/hosts/callisto; }; adrastea = buildLiminalOS { inherit inputs nixpkgs; - systemModule = ./hosts/adrastea; + systemModule = ./reference/hosts/adrastea; }; cassini = buildLiminalOS { inherit inputs nixpkgs; - systemModule = ./hosts/cassini; + systemModule = ./reference/hosts/cassini; }; }; darwinConfigurations.phobos = nix-darwin.lib.darwinSystem { @@ -146,7 +147,12 @@ }; }; perSystem = - { pkgs, system, ... }: + { + pkgs, + system, + config, + ... + }: { formatter = pkgs.nixfmt-rfc-style; @@ -164,6 +170,16 @@ inputs.viminal.packages.${system}.default ]; }; + + nixosModules = { + default = config.nixosModules.liminalOS; + liminalOS = ./modules/default.nix; + }; + + homeManagerModules = { + default = config.homeManagerModules.liminalOS; + liminalOS = ./hm/modules/default.nix; + }; }; }; } diff --git a/hm/default.nix b/hm/default.nix new file mode 100644 index 0000000..2c3bf2f --- /dev/null +++ b/hm/default.nix @@ -0,0 +1,29 @@ +{ + inputs, + config, + lib, + ... +}: +let + cfg = config.liminalOS; +in +{ + imports = [ + inputs.home-manager.nixosModules.home-manager + ]; + + options.liminalOS.integrateHomeManager = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to activate home manager with default options. Keep in mind you still have to import the liminalOS home-manager module. + ''; + }; + + config.home-manager = lib.mkIf cfg.integrateHomeManager { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "backup"; + extraSpecialArgs = { inherit inputs; }; + }; +} diff --git a/hm/modules/common/default.nix b/hm/modules/common/default.nix new file mode 100644 index 0000000..a955cfd --- /dev/null +++ b/hm/modules/common/default.nix @@ -0,0 +1,10 @@ +{ + imports = [ ./shellenv ]; + # Let home Manager install and manage itself. + programs.home-manager.enable = true; + + home.file.".essentials" = { + source = ./essentials; + recursive = true; + }; +} diff --git a/hm/modules/common/essentials/README.md b/hm/modules/common/essentials/README.md new file mode 100644 index 0000000..5d8c79d --- /dev/null +++ b/hm/modules/common/essentials/README.md @@ -0,0 +1 @@ +This place contains all of the stuff that is too hard or unwieldy to manage fully with nix, but is still useful to have ready on every system. diff --git a/hm/modules/common/essentials/tabliss.json b/hm/modules/common/essentials/tabliss.json new file mode 100644 index 0000000..c4ff7a1 --- /dev/null +++ b/hm/modules/common/essentials/tabliss.json @@ -0,0 +1 @@ +{"locale":"en","widget/QmFu0MVUS_uo":null,"widget/cMOmcy4ZqrjS":null,"widget/i54ELqP74_Sv":null,"widget/B_kz3lJkUxlp":null,"widget/Yvubo6Zu9lT8":null,"widget/MHcdYwMetd1i":null,"timeZone":null,"widget/Dj61R7yvYklL":null,"data/He0QCGvD65VV":{"messages":["There is no system but GNU, and Linux is one of its kernels."]},"widget/RuC5niQwKdxR":null,"widget/LCUpMUdJn0Yf":null,"widget/yJ9fL4n4XbdH":null,"widget/FkVDvMgaeXIG":null,"widget/L8ulAGK5O_0u":{"id":"L8ulAGK5O_0u","key":"widget/literature-clock","order":1,"display":{"position":"middleCentre","fontFamily":"Lora"}},"data/default-unsplash":{"by":"topics","collections":"","featured":false,"paused":false,"search":"","topics":"xHxYTMHLgOc","timeout":900},"data/y8f2hoHcUia3":{"columns":3,"links":[{"url":"https://github.com/","icon":"github"},{"url":"https://www.youtube.com/","icon":"youtube"},{"url":"https://github.com/youwen5","icon":"user"}],"visible":true,"linkOpenStyle":false},"widget/sqbQm1Apn-Ad":null,"widget/1SHRYajLSARQ":{"id":"1SHRYajLSARQ","key":"widget/weather","order":0,"display":{"position":"topCentre","fontSize":26,"fontFamily":"Lora"}},"widget/He0QCGvD65VV":{"id":"He0QCGvD65VV","key":"widget/message","order":5,"display":{"position":"bottomCentre","fontFamily":"Lora","fontWeight":400}},"widget/y8f2hoHcUia3":{"id":"y8f2hoHcUia3","key":"widget/links","order":4,"display":{"position":"middleCentre"}},"widget/KNX14ZQq5_lc":{"id":"KNX14ZQq5_lc","key":"widget/css","order":2,"display":{"position":"middleCentre","fontFamily":""}},"widget/rOHrlmChb_Sp":null,"data/KNX14ZQq5_lc":{"input":"\n.Widget .LiteratureClock {\n padding: 20px;\n background-color: rgba(0,0,0,0.1);\n border-radius: 20px;\n backdrop-filter: blur(4px);\n font-size: 1.2em;\n max-width: 800px;\n}\n\n.Widget .Message {\n margin-bottom: 60px;\n}\n\n\n.Widget {\n user-select: none;\n}\n\n.Widget .Weather {\n padding: 20px;\n}\n\n.Widget .Links {\n margin-top: 40px;\n}\n.Widget .Links a:hover {\n scale: 1.15;\n}"},"background":{"id":"default-unsplash","key":"background/unsplash","display":{"luminosity":-0.2,"blur":0}},"widget/default-time":null,"widget/default-greeting":null,"focus":false,"data/1SHRYajLSARQ":{"showDetails":false,"units":"us","latitude":34.4133,"longitude":-119.861,"name":"Isla Vista"},"version":3} \ No newline at end of file diff --git a/hm/modules/common/essentials/vencord-settings.json b/hm/modules/common/essentials/vencord-settings.json new file mode 100644 index 0000000..b147d49 --- /dev/null +++ b/hm/modules/common/essentials/vencord-settings.json @@ -0,0 +1,617 @@ +{ + "settings": { + "autoUpdate": true, + "autoUpdateNotification": true, + "useQuickCss": true, + "themeLinks": [ + "https://raw.githubusercontent.com/catppuccin/discord/main/themes/macchiato.theme.css" + ], + "enabledThemes": [ + "stylix.theme.css" + ], + "enableReactDevtools": false, + "frameless": false, + "transparent": false, + "winCtrlQ": false, + "disableMinSize": false, + "winNativeTitleBar": false, + "plugins": { + "ChatInputButtonAPI": { + "enabled": false + }, + "CommandsAPI": { + "enabled": true + }, + "MemberListDecoratorsAPI": { + "enabled": false + }, + "MessageAccessoriesAPI": { + "enabled": true + }, + "MessageDecorationsAPI": { + "enabled": false + }, + "MessageEventsAPI": { + "enabled": true + }, + "MessagePopoverAPI": { + "enabled": false + }, + "MessageUpdaterAPI": { + "enabled": false + }, + "ServerListAPI": { + "enabled": true + }, + "UserSettingsAPI": { + "enabled": true + }, + "AlwaysAnimate": { + "enabled": false + }, + "AlwaysTrust": { + "enabled": true, + "domain": true, + "file": true + }, + "AnonymiseFileNames": { + "enabled": true, + "anonymiseByDefault": true, + "method": 0, + "randomisedLength": 7 + }, + "AppleMusicRichPresence": { + "enabled": false + }, + "WebRichPresence (arRPC)": { + "enabled": false + }, + "AutomodContext": { + "enabled": false + }, + "BANger": { + "enabled": false + }, + "BetterFolders": { + "enabled": true, + "sidebar": true, + "showFolderIcon": 1, + "keepIcons": false, + "closeAllHomeButton": false, + "closeAllFolders": false, + "forceOpen": false, + "sidebarAnim": true + }, + "BetterGifAltText": { + "enabled": false + }, + "BetterGifPicker": { + "enabled": false + }, + "BetterNotesBox": { + "enabled": false + }, + "BetterRoleContext": { + "enabled": false + }, + "BetterRoleDot": { + "enabled": true, + "bothStyles": false, + "copyRoleColorInProfilePopout": false + }, + "BetterSessions": { + "enabled": true, + "backgroundCheck": false + }, + "BetterSettings": { + "enabled": false, + "disableFade": true, + "eagerLoad": true + }, + "BetterUploadButton": { + "enabled": false + }, + "BiggerStreamPreview": { + "enabled": false + }, + "BlurNSFW": { + "enabled": false + }, + "CallTimer": { + "enabled": true + }, + "ClearURLs": { + "enabled": true + }, + "ClientTheme": { + "enabled": false + }, + "ColorSighted": { + "enabled": false + }, + "ConsoleJanitor": { + "enabled": false + }, + "ConsoleShortcuts": { + "enabled": false + }, + "CopyEmojiMarkdown": { + "enabled": false + }, + "CopyUserURLs": { + "enabled": true + }, + "CrashHandler": { + "enabled": true + }, + "CtrlEnterSend": { + "enabled": false + }, + "CustomRPC": { + "enabled": false + }, + "CustomIdle": { + "enabled": false + }, + "Dearrow": { + "enabled": false + }, + "Decor": { + "enabled": false + }, + "DisableCallIdle": { + "enabled": false + }, + "DontRoundMyTimestamps": { + "enabled": false + }, + "EmoteCloner": { + "enabled": false + }, + "Experiments": { + "enabled": false + }, + "F8Break": { + "enabled": false + }, + "FakeNitro": { + "enabled": false + }, + "FakeProfileThemes": { + "enabled": false + }, + "FavoriteEmojiFirst": { + "enabled": false + }, + "FavoriteGifSearch": { + "enabled": false + }, + "FixCodeblockGap": { + "enabled": false + }, + "FixSpotifyEmbeds": { + "enabled": false + }, + "FixYoutubeEmbeds": { + "enabled": false + }, + "ForceOwnerCrown": { + "enabled": false + }, + "FriendInvites": { + "enabled": false + }, + "FriendsSince": { + "enabled": false + }, + "GameActivityToggle": { + "enabled": false + }, + "GifPaste": { + "enabled": false + }, + "GreetStickerPicker": { + "enabled": false + }, + "HideAttachments": { + "enabled": false + }, + "iLoveSpam": { + "enabled": false + }, + "IgnoreActivities": { + "enabled": false + }, + "ImageLink": { + "enabled": false + }, + "ImageZoom": { + "enabled": false + }, + "ImplicitRelationships": { + "enabled": false + }, + "InvisibleChat": { + "enabled": false + }, + "KeepCurrentChannel": { + "enabled": false + }, + "LastFMRichPresence": { + "enabled": false + }, + "LoadingQuotes": { + "enabled": false + }, + "MaskedLinkPaste": { + "enabled": false + }, + "MemberCount": { + "enabled": false + }, + "MessageClickActions": { + "enabled": false + }, + "MessageLatency": { + "enabled": false + }, + "MessageLinkEmbeds": { + "enabled": false + }, + "MessageLogger": { + "enabled": false + }, + "MessageTags": { + "enabled": false + }, + "MoreCommands": { + "enabled": false + }, + "MoreKaomoji": { + "enabled": false + }, + "MoreUserTags": { + "enabled": false + }, + "Moyai": { + "enabled": false + }, + "MutualGroupDMs": { + "enabled": false + }, + "NewGuildSettings": { + "enabled": false + }, + "NoBlockedMessages": { + "enabled": false + }, + "NoDefaultHangStatus": { + "enabled": false + }, + "NoDevtoolsWarning": { + "enabled": false + }, + "NoF1": { + "enabled": false + }, + "NoMosaic": { + "enabled": false + }, + "NoOnboardingDelay": { + "enabled": false + }, + "NoPendingCount": { + "enabled": false + }, + "NoProfileThemes": { + "enabled": false + }, + "NoReplyMention": { + "enabled": false + }, + "NoScreensharePreview": { + "enabled": false + }, + "NoServerEmojis": { + "enabled": false + }, + "NoTypingAnimation": { + "enabled": false + }, + "NoUnblockToJump": { + "enabled": false + }, + "NormalizeMessageLinks": { + "enabled": false + }, + "NotificationVolume": { + "enabled": false + }, + "NSFWGateBypass": { + "enabled": false + }, + "OnePingPerDM": { + "enabled": false + }, + "oneko": { + "enabled": false + }, + "OpenInApp": { + "enabled": false + }, + "OverrideForumDefaults": { + "enabled": false + }, + "PartyMode": { + "enabled": false + }, + "PauseInvitesForever": { + "enabled": false + }, + "PermissionFreeWill": { + "enabled": false + }, + "PermissionsViewer": { + "enabled": false + }, + "petpet": { + "enabled": false + }, + "PictureInPicture": { + "enabled": false + }, + "PinDMs": { + "enabled": false + }, + "PlainFolderIcon": { + "enabled": false + }, + "PlatformIndicators": { + "enabled": false + }, + "PreviewMessage": { + "enabled": false + }, + "QuickMention": { + "enabled": false + }, + "QuickReply": { + "enabled": false + }, + "ReactErrorDecoder": { + "enabled": false + }, + "ReadAllNotificationsButton": { + "enabled": true + }, + "RelationshipNotifier": { + "enabled": false + }, + "ReplaceGoogleSearch": { + "enabled": false + }, + "ReplyTimestamp": { + "enabled": false + }, + "RevealAllSpoilers": { + "enabled": false + }, + "ReverseImageSearch": { + "enabled": false + }, + "ReviewDB": { + "enabled": false + }, + "RoleColorEverywhere": { + "enabled": false + }, + "SecretRingToneEnabler": { + "enabled": false + }, + "Summaries": { + "enabled": false + }, + "SendTimestamps": { + "enabled": false + }, + "ServerInfo": { + "enabled": false + }, + "ServerListIndicators": { + "enabled": false + }, + "ShikiCodeblocks": { + "enabled": false + }, + "ShowAllMessageButtons": { + "enabled": false + }, + "ShowConnections": { + "enabled": false + }, + "ShowHiddenChannels": { + "enabled": true, + "showMode": 0, + "hideUnreads": true + }, + "ShowHiddenThings": { + "enabled": true, + "showTimeouts": true, + "showInvitesPaused": true, + "showModView": true, + "disableDiscoveryFilters": true, + "disableDisallowedDiscoveryFilters": true + }, + "ShowMeYourName": { + "enabled": false + }, + "ShowTimeoutDuration": { + "enabled": false + }, + "SilentMessageToggle": { + "enabled": false + }, + "SilentTyping": { + "enabled": false + }, + "SortFriendRequests": { + "enabled": false + }, + "SpotifyControls": { + "enabled": true, + "hoverControls": false + }, + "SpotifyCrack": { + "enabled": false + }, + "SpotifyShareCommands": { + "enabled": false + }, + "StartupTimings": { + "enabled": false + }, + "StreamerModeOnStream": { + "enabled": false + }, + "SuperReactionTweaks": { + "enabled": false + }, + "TextReplace": { + "enabled": false + }, + "ThemeAttributes": { + "enabled": false + }, + "TimeBarAllActivities": { + "enabled": false + }, + "Translate": { + "enabled": false + }, + "TypingIndicator": { + "enabled": false + }, + "TypingTweaks": { + "enabled": false + }, + "Unindent": { + "enabled": false + }, + "UnlockedAvatarZoom": { + "enabled": false + }, + "UnsuppressEmbeds": { + "enabled": false + }, + "UserVoiceShow": { + "enabled": false + }, + "USRBG": { + "enabled": false + }, + "ValidReply": { + "enabled": false + }, + "ValidUser": { + "enabled": false + }, + "VoiceChatDoubleClick": { + "enabled": false + }, + "VcNarrator": { + "enabled": false + }, + "VencordToolbox": { + "enabled": false + }, + "ViewIcons": { + "enabled": false + }, + "ViewRaw": { + "enabled": false + }, + "VoiceDownload": { + "enabled": false + }, + "VoiceMessages": { + "enabled": false + }, + "WebKeybinds": { + "enabled": true + }, + "WebScreenShareFixes": { + "enabled": true + }, + "WhoReacted": { + "enabled": false + }, + "XSOverlay": { + "enabled": false + }, + "NoTrack": { + "enabled": true, + "disableAnalytics": true + }, + "WebContextMenus": { + "enabled": true, + "addBack": true + }, + "Settings": { + "enabled": true, + "settingsLocation": "aboveNitro" + }, + "SupportHelper": { + "enabled": true + }, + "YoutubeAdblock": { + "enabled": true + }, + "AlwaysExpandRoles": { + "enabled": false + }, + "FullSearchContext": { + "enabled": false + }, + "UserMessagesPronouns": { + "enabled": false + }, + "DynamicImageModalAPI": { + "enabled": false + }, + "AccountPanelServerProfile": { + "enabled": false + }, + "CopyFileContents": { + "enabled": false + }, + "FixImagesQuality": { + "enabled": false + }, + "MentionAvatars": { + "enabled": false + }, + "NoMaskedUrlPaste": { + "enabled": false + }, + "StickerPaste": { + "enabled": false + }, + "VolumeBooster": { + "enabled": false + } + }, + "notifications": { + "timeout": 5000, + "position": "bottom-right", + "useNative": "not-focused", + "logLimit": 50 + }, + "cloud": { + "authenticated": false, + "url": "https://api.vencord.dev/", + "settingsSync": false, + "settingsSyncVersion": 1730351821316 + } + }, + "quickCss": "" +} \ No newline at end of file diff --git a/hm/modules/common/shellenv/default.nix b/hm/modules/common/shellenv/default.nix new file mode 100644 index 0000000..a6d1d43 --- /dev/null +++ b/hm/modules/common/shellenv/default.nix @@ -0,0 +1,212 @@ +{ + config, + lib, + inputs, + pkgs, + osConfig, + ... +}: +let + cfg = config.liminalOS; +in +{ + imports = [ + inputs.nix-index-database.hmModules.nix-index + ./fastfetch + ]; + + options.liminalOS.shellEnv = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to set up a CLI development environment. + ''; + }; + }; + + config = lib.mkIf cfg.shellEnv.enable { + + programs.bash.enable = true; + + programs.nushell = { + enable = true; + configFile.text = '' + $env.config = { + edit_mode: vi, + show_banner: false + } + ''; + }; + + programs.fzf = { + enable = true; + }; + + programs.git = { + enable = true; + userName = lib.mkDefault "liminalOS user"; + userEmail = lib.mkDefault "liminalOS@localhost"; + delta.enable = true; + maintenance.enable = true; + extraConfig = { + init.defaultBranch = "main"; + safe.directory = [ + osConfig.liminalOS.flakeLocation + ]; + }; + }; + + home.packages = [ pkgs.git-absorb ]; + + programs.lazygit = { + enable = true; + settings = { + git.paging = { + colorArg = "always"; + pager = "delta --dark --paging=never"; + }; + }; + }; + + programs.bat.enable = true; + + programs.ripgrep.enable = true; + + programs.readline = { + enable = true; + extraConfig = "set editing-mode vi"; + }; + + programs.zoxide = { + enable = true; + enableFishIntegration = true; + enableNushellIntegration = true; + enableBashIntegration = true; + }; + + programs.gh = { + enable = true; + }; + + programs.starship = { + enable = true; + enableFishIntegration = true; + enableBashIntegration = true; + enableNushellIntegration = true; + }; + + home.file.".config/starship.toml".text = builtins.readFile ./jetpack.toml; + + programs.direnv = { + enable = true; + nix-direnv.enable = true; + config.global.hide_env_diff = true; + }; + + programs.fish = { + enable = true; + shellAliases = { + ls = "eza -l --icons=auto"; + neofetch = "${pkgs.fastfetch}/bin/fastfetch"; + }; + interactiveShellInit = '' + fish_vi_key_bindings + set -g fish_greeting + ''; + plugins = [ + { + name = "autopair"; + src = pkgs.fetchFromGitHub { + owner = "jorgebucaran"; + repo = "autopair.fish"; + rev = "4d1752ff5b39819ab58d7337c69220342e9de0e2"; + hash = "sha256-qt3t1iKRRNuiLWiVoiAYOu+9E7jsyECyIqZJ/oRIT1A="; + }; + } + { + name = "fzf"; + src = pkgs.fetchFromGitHub { + owner = "PatrickF1"; + repo = "fzf.fish"; + rev = "8920367cf85eee5218cc25a11e209d46e2591e7a"; + hash = "sha256-T8KYLA/r/gOKvAivKRoeqIwE2pINlxFQtZJHpOy9GMM="; + }; + } + { + name = "sponge"; + src = pkgs.fetchFromGitHub { + owner = "meaningful-ooo"; + repo = "sponge"; + rev = "384299545104d5256648cee9d8b117aaa9a6d7be"; + hash = "sha256-MdcZUDRtNJdiyo2l9o5ma7nAX84xEJbGFhAVhK+Zm1w="; + }; + } + { + name = "done"; + src = pkgs.fetchFromGitHub { + owner = "franciscolourenco"; + repo = "done"; + rev = "eb32ade85c0f2c68cbfcff3036756bbf27a4f366"; + hash = "sha256-DMIRKRAVOn7YEnuAtz4hIxrU93ULxNoQhW6juxCoh4o="; + }; + } + ]; + }; + + programs.nix-index = { + enable = true; + enableBashIntegration = true; + enableFishIntegration = true; + }; + + programs.nix-index-database.comma.enable = true; + + programs.fd.enable = true; + + programs.btop = { + enable = true; + settings = { + vim_keys = true; + theme_background = false; + }; + }; + + programs.eza = { + enable = true; + enableFishIntegration = true; + enableBashIntegration = true; + git = true; + }; + + programs.yazi = { + enable = true; + enableBashIntegration = true; + enableFishIntegration = true; + plugins = { + mediainfo = pkgs.fetchFromGitHub { + owner = "Ape"; + repo = "mediainfo.yazi"; + rev = "c69314e80f5b45fe87a0e06a10d064ed54110439"; + hash = "sha256-8xdBPdKSiwB7iRU8DJdTHY+BjfR9D3FtyVtDL9tNiy4="; + }; + }; + settings = { + plugin = { + prepend_previewers = [ + { + mime = "{image,audio,video}/*"; + run = "mediainfo"; + } + { + mime = "application/x-subrip"; + run = "mediainfo"; + } + ]; + }; + }; + }; + + programs.zathura.enable = true; + }; +} diff --git a/hm/modules/common/shellenv/fastfetch/config.json b/hm/modules/common/shellenv/fastfetch/config.json new file mode 100644 index 0000000..2021c56 --- /dev/null +++ b/hm/modules/common/shellenv/fastfetch/config.json @@ -0,0 +1,81 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "display": { + "separator": " " + }, + "modules": [ + "break", + "break", + "break", + "break", + "break", + { + "type": "title", + "keyWidth": 10 + }, + "break", + { + "type": "os", + "key": " ", + "keyColor": "34", + "format": "{3} on {12}" + }, + { + "type": "kernel", + "key": " ", + "keyColor": "34" + }, + { + "type": "packages", + "key": " ", + "keyColor": "34" + }, + { + "type": "shell", + "key": " ", + "keyColor": "34" + }, + { + "type": "terminal", + "key": " ", + "keyColor": "34" + }, + { + "type": "wm", + "key": " ", + "keyColor": "34" + }, + { + "type": "CPU", + "key": " ", + "keyColor": "34" + }, + { + "type": "GPU", + "key": "󰍹 ", + "keyColor": "34" + }, + { + "type": "uptime", + "key": " ", + "keyColor": "34" + }, + { + "type": "media", + "key": "󰝚 ", + "keyColor": "34" + }, + { + "type": "player", + "key": " ", + "keyColor": "34" + }, + "break", + { + "type": "custom", + "format": "\u001b[90m \u001b[31m \u001b[32m \u001b[33m \u001b[34m \u001b[35m \u001b[36m \u001b[37m " + }, + "break", + "break" + ] +} diff --git a/hm/modules/common/shellenv/fastfetch/default.nix b/hm/modules/common/shellenv/fastfetch/default.nix new file mode 100644 index 0000000..a7fc792 --- /dev/null +++ b/hm/modules/common/shellenv/fastfetch/default.nix @@ -0,0 +1,39 @@ +{ config, lib, ... }: +let + fastfetchConfig = builtins.fromJSON (builtins.readFile ./config.json); + cfg = config.liminalOS.shellEnv.fastfetch; +in +{ + options.liminalOS.shellEnv.fastfetch = { + enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.shellEnv.enable; + description = '' + Whether to set up and configure fastfetch. + ''; + }; + useKittyImage = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to use the kitty image protocol. + ''; + }; + }; + config.programs.fastfetch = lib.mkIf cfg.enable { + enable = true; + settings = ( + fastfetchConfig + // { + logo = { + height = 18; + padding = { + top = 2; + }; + type = if cfg.useKittyImage then "kitty" else "auto"; + source = lib.mkIf cfg.useKittyImage ./nixos-logo.png; + }; + } + ); + }; +} diff --git a/hm/modules/common/shellenv/fastfetch/nixos-logo.png b/hm/modules/common/shellenv/fastfetch/nixos-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..acbaad447a878c1a51db324ed07d8e938cb38127 GIT binary patch literal 28684 zcmdpe_al}6`~Q6o$KJf`ag0!i$SCC4l#HxOHrX8w+0Ky>WtLS6B_lGDk#)`qNp{&8 z$4Epv_BkBqoX@TI_pkW+B|kX#xt`bcxYpzGyi2yWG-YQ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|^7Kapdh<+vyj*Y$^KtWJS-N1YWEfG+DB9gWfVL}u+Au%E|Q#i$&-V /dev/null + if contains -- os $argv or contains -- clean $argv + doas ${pkgs.nh}/bin/nh $argv -R + else + ${pkgs.nh}/bin/nh $argv + end + else + ${pkgs.nh}/bin/nh + end + ''; + }; + spt = "${pkgs.spotify-player}/bin/spotify_player"; + }; + + home.file = lib.mkIf config.liminalOS.programs.enable { + ".config/vesktop/settings.json".source = config.lib.file.mkOutOfStoreSymlink ./var/settings.json; + }; +} diff --git a/hm/modules/linux/desktop-environment/default.nix b/hm/modules/linux/desktop-environment/default.nix new file mode 100644 index 0000000..e4f9b7a --- /dev/null +++ b/hm/modules/linux/desktop-environment/default.nix @@ -0,0 +1,23 @@ +{ + osConfig, + config, + lib, + ... +}: +{ + imports = [ + ./hyprland + ./waybar + ./swaync.nix + ]; + + options.liminalOS.desktop = { + enable = lib.mkOption { + type = lib.types.bool; + default = osConfig.liminalOS.desktop.enable; + description = '' + Whether to enable the default configuration for the userland portions of the liminalOS desktop environment. + ''; + }; + }; +} diff --git a/hm/modules/linux/desktop-environment/hyprland/default.nix b/hm/modules/linux/desktop-environment/hyprland/default.nix new file mode 100644 index 0000000..207d31b --- /dev/null +++ b/hm/modules/linux/desktop-environment/hyprland/default.nix @@ -0,0 +1,394 @@ +{ + pkgs, + config, + lib, + osConfig, + ... +}: +let + cfg = config.liminalOS.desktop.hyprland; +in +{ + options.liminalOS.desktop.hyprland = { + enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.desktop.enable; + description = '' + Whether to enable and rice Hyprland as well as some basic desktop utilities. + ''; + }; + applyGtkFix = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to set GSK_RENDERER environment variable to stop GTK apps from crashing. + ''; + }; + idleDaemon.enable = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to setup and enable Hypridle with some defaults to automatically lock the screen and suspend after idling. + ''; + }; + screenlocker.enable = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to set up Hyprlock for screen locking. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + home.packages = + with pkgs; + [ + wl-clipboard + libsForQt5.qtstyleplugin-kvantum + libsForQt5.qt5ct + papirus-icon-theme + libsForQt5.qt5ct + ] + ++ (lib.optionals (!osConfig.liminalOS.theming.enable) [ + pkgs.bibata-cursors + ]); + + wayland.windowManager.hyprland = { + enable = true; + settings = { + "$mod" = "SUPER"; + "$Left" = "H"; + "$Right" = "L"; + "$Up" = "K"; + "$Down" = "J"; + env = + (lib.optionals cfg.applyGtkFix [ + "GSK_RENDERER,gl" + ]) + ++ (lib.optionals (config.liminalOS.formFactor == "laptop" && !osConfig.liminalOS.theming.enable) [ + "HYPRCURSOR_THEME,Bibata-Modern-Ice" + "HYPRCURSOR_SIZE,24" + "XCURSOR_THEME,Bibata-Modern-Ice" + "XCURSOR_SIZE,24" + ]) + ++ (lib.optionals (config.liminalOS.formFactor == "desktop" && !osConfig.liminalOS.theming.enable) [ + "HYPRCURSOR_THEME,Bibata-Modern-Ice" + "HYPRCURSOR_SIZE,26" + "XCURSOR_THEME,Bibata-Modern-Ice" + "XCURSOR_SIZE,26" + ]); + bind = + [ + # Window actions + "$mod, Q, killactive" + "$mod, W, togglefloating" + "$mod, V, togglesplit" + "$mod, Return, fullscreen" + + # Move around + "$mod, $Left, movefocus, l" + "$mod, $Right, movefocus, r" + "$mod, $Up, movefocus, u" + "$mod, $Down, movefocus, d" + + "$mod, D, workspace, previous" + + "$mod, 1, workspace, 1" + "$mod+Ctrl, H, workspace, 1" + "$mod, 2, workspace, 2" + "$mod+Ctrl, J, workspace, 2" + "$mod, 3, workspace, 3" + "$mod+Ctrl, K, workspace, 3" + "$mod, 4, workspace, 4" + "$mod+Ctrl, L, workspace, 4" + "$mod, 5, workspace, 5" + "$mod+Ctrl, semicolon, workspace, 5" + "$mod, 6, workspace, 6" + "$mod+Ctrl, apostrophe, workspace, 6" + "$mod, 7, workspace, 7" + "$mod+Ctrl, U, workspace, 7" + "$mod, 8, workspace, 8" + "$mod+Ctrl, I, workspace, 8" + "$mod, 9, workspace, 9" + "$mod+Ctrl, O, workspace, 9" + "$mod, 0, workspace, 10" + "$mod+Ctrl, P, workspace, 10" + + # Move active window to a workspace with mainMod + SHIFT + [0-9] + "$mod+Shift, 1, movetoworkspace, 1" + "$mod+Ctrl+Shift, H, movetoworkspace, 1" + "$mod+Shift, 2, movetoworkspace, 2" + "$mod+Ctrl+Shift, J, movetoworkspace, 2" + "$mod+Shift, 3, movetoworkspace, 3" + "$mod+Ctrl+Shift, K, movetoworkspace, 3" + "$mod+Shift, 4, movetoworkspace, 4" + "$mod+Ctrl+Shift, L, movetoworkspace, 4" + "$mod+Shift, 5, movetoworkspace, 5" + "$mod+Ctrl+Shift, semicolon, movetoworkspace, 5" + "$mod+Shift, 6, movetoworkspace, 6" + "$mod+Ctrl+Shift, apostrophe, movetoworkspace, 6" + "$mod+Shift, 7, movetoworkspace, 7" + "$mod+Ctrl+Shift, U, movetoworkspace, 7" + "$mod+Shift, 8, movetoworkspace, 8" + "$mod+Ctrl+Shift, I, movetoworkspace, 8" + "$mod+Shift, 9, movetoworkspace, 9" + "$mod+Ctrl+Shift, O, movetoworkspace, 9" + "$mod+Shift, 0, movetoworkspace, 10" + "$mod+Ctrl+Shift, P, movetoworkspace, 10" + + # Special workspace + "$mod, S, togglespecialworkspace" + "$mod+Alt, S, movetoworkspacesilent, special" + + # Move windows around + "$mod+Shift, $Left, movewindow, l" + "$mod+Shift, $Right, movewindow, r" + "$mod+Shift, $Up, movewindow, u" + "$mod+Shift, $Down, movewindow, d" + + "$mod+Ctrl, bracketright, movetoworkspace, r+1" + "$mod+Ctrl, bracketleft, movetoworkspace, r-1" + + "$mod, bracketright, workspace, r+1" + "$mod, bracketleft, workspace, r-1" + + # Utilities + "$mod, Space, exec, pkill -x rofi || rofi -show drun" # Run rofi application launcher + "$mod, G, exec, pkill -x rofi || rofi -show window" # Run rofi window switcher + + ''$mod, P, exec, ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.swappy}/bin/swappy -f -'' # Screenshot + ''$mod+Shift, P, exec, ${pkgs.grim}/bin/grim - | ${pkgs.swappy}/bin/swappy -f -'' # Screenshot + + "$mod, Backspace, exec, pkill -x wlogout || wlogout" # show logout menu + + "$mod, Z, exec, loginctl lock-session" + + # Media controls + ",XF86AudioMute, exec, ${pkgs.pamixer}/bin/pamixer -t" + ",XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl --player=%any,firefox play-pause" + ",XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl --player=%any,firefox next" + ",XF86AudioRewind, exec, ${pkgs.playerctl}/bin/playerctl --player=%any,firefox previous" + ] + ++ (lib.optionals config.liminalOS.programs.zen.enable [ + "$mod, F, exec, zen" + ]) + ++ (lib.optionals config.liminalOS.desktop.swaync.enable [ + "$mod, N, exec, sleep 0.1 && ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw" + ]) + ++ (lib.optionals config.liminalOS.programs.enable [ + # Application Keybinds + "$mod, R, exec, ${pkgs.pavucontrol}/bin/pavucontrol -t 3" # open pavucontrol on 'outputs' tab + "$mod, T, exec, ${pkgs.kitty}/bin/kitty" + "$mod, E, exec, ${pkgs.xfce.thunar}/bin/thunar" + "$mod, M, exec, ${pkgs.thunderbird}/bin/thunderbird" + ]); + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + bindel = [ + ",XF86MonBrightnessDown, exec, ${pkgs.brightnessctl}/bin/brightnessctl set 5%-" + ",XF86MonBrightnessUp, exec, ${pkgs.brightnessctl}/bin/brightnessctl set 5%+" + ",XF86AudioRaiseVolume, exec, ${pkgs.pamixer}/bin/pamixer -i 5" + ",XF86AudioLowerVolume, exec, ${pkgs.pamixer}/bin/pamixer -d 5" + ]; + binde = [ + # Resize windows + "$mod+Alt, $Right, resizeactive, 30 0" + "$mod+Alt, $Left, resizeactive, -30 0" + "$mod+Alt, $Up, resizeactive, 0 -30" + "$mod+Alt, $Down, resizeactive, 0 30" + ]; + windowrulev2 = import ./windowrulev2.nix; + layerrule = [ + "blur,rofi" + "ignorezero,rofi" + "animation slide bottom 0.2 0.2 wind,rofi" + "blur,notifications" + "ignorezero,notifications" + "blur,swaync-notification-window" + "animation slide right 0.5 0.5,swaync-control-center" + "animation slide right 0.5 0.5,notifications" + "animation slide right 0.5 0.5,swaync-notification-window" + "ignorezero,swaync-notification-window" + "blur,swaync-control-center" + "ignorezero,swaync-control-center" + "blur,logout_dialog" + ]; + dwindle = { + pseudotile = "yes"; + preserve_split = "yes"; + }; + animations = { + enabled = "yes"; + bezier = [ + "wind, 0.05, 0.9, 0.1, 1.05" + "winIn, 0.1, 1.1, 0.1, 1.1" + "winOut, 0.3, -0.3, 0, 1" + "liner, 1, 1, 1, 1" + ]; + animation = [ + "windows, 1, 6, wind, slide" + "windowsIn, 1, 6, winIn, slide" + "windowsOut, 1, 5, winOut, slide" + "windowsMove, 1, 5, wind, slide" + # "border, 1, 1, liner" + # "borderangle, 1, 30, liner, loop" + "fade, 1, 10, default" + "workspaces, 1, 5, wind" + # "layers, 1, 8, default, slide" + ]; + }; + + general = { + gaps_in = "3"; + gaps_out = "8"; + border_size = "2"; + # the dot is a hyprland name, not nix syntax, so we escape it + "col.active_border" = pkgs.lib.mkForce "rgba(ca9ee6ff) rgba(f2d5cfff) 45deg"; + "col.inactive_border" = pkgs.lib.mkForce "rgba(b4befecc) rgba(6c7086cc) 45deg"; + layout = "dwindle"; + resize_on_border = "true"; + }; + + misc = { + disable_hyprland_logo = true; + disable_splash_rendering = true; + }; + + cursor = { + hide_on_key_press = true; + }; + + decoration = { + rounding = "10"; + dim_special = "0.3"; + blur = { + enabled = "yes"; + size = "6"; + passes = "3"; + new_optimizations = "on"; + ignore_opacity = "on"; + xray = "false"; + special = true; + }; + shadow = { + enabled = false; + }; + }; + input = { + sensitivity = if config.liminalOS.formFactor == "laptop" then "0.0" else "-0.65"; + }; + }; + }; + + wayland.windowManager.hyprland.settings.input.touchpad = + lib.mkIf (config.liminalOS.formFactor == "laptop") + { + natural_scroll = true; + disable_while_typing = true; + clickfinger_behavior = true; + tap-to-click = false; + scroll_factor = 0.15; + }; + + services.hyprpaper.enable = true; + + programs.wlogout.enable = true; + + programs.rofi = { + enable = true; + package = pkgs.rofi-wayland; + # theme = "gruvbox-dark"; + terminal = "${pkgs.kitty}/bin/kitty"; + extraConfig = { + modi = "window,drun,ssh,combi,filebrowser,recursivebrowser"; + display-drun = " 󰘧 "; + combi-modi = "window,drun,ssh"; + run-shell-command = "{terminal} -e {cmd}"; + sidebar-mode = true; + background-color = "transparent"; + sorting = "fuzzy"; + }; + }; + + programs.hyprlock = lib.mkIf cfg.screenlocker.enable { + enable = true; + settings = { + general = { + hide_cursor = true; + grace = 1; + }; + background = { + monitor = ""; + path = "/tmp/__hyprlock-monitor-screenshot.png"; + blur_passes = 3; + blur_size = 7; + noise = 0.0117; + contrast = 0.8916; + brightness = 0.8172; + vibrancy = 0.1696; + vibrancy_darkness = 0.0; + }; + input-field = { + monitor = ""; + size = "200, 50"; + outline_thickness = 3; + dots_size = 0.33; + dots_spacing = 0.15; + dots_center = false; + dots_rounding = -1; + outer_color = "rgb(151515)"; + inner_color = "rgb(200, 200, 200)"; + font_color = "rgb(10, 10, 10)"; + fade_on_empty = true; + fade_timeout = 1000; + placeholder_text = "Input Password..."; + hide_input = false; + rounding = -1; + check_color = "rgb(204, 136, 34)"; + fail_color = "rgb(204, 34, 34)"; + fail_text = "$FAIL ($ATTEMPTS)"; + fail_timeout = 2000; + fail_transition = 300; + capslock_color = -1; + numlock_color = -1; + bothlock_color = -1; + invert_numlock = false; + swap_font_color = false; + + position = "0, -20"; + halign = "center"; + valign = "center"; + }; + }; + }; + + services.hypridle = lib.mkIf cfg.idleDaemon.enable { + enable = true; + settings = { + general = { + lock_cmd = "pidof hyprlock || ${pkgs.grim}/bin/grim -o ${config.programs.hyprlock.settings.background.monitor} /tmp/__hyprlock-monitor-screenshot.png && ${pkgs.hyprlock}/bin/hyprlock"; # avoid starting multiple hyprlock instances. + before_sleep_cmd = "loginctl lock-session"; # lock before suspend. + after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display. + }; + listener = [ + { + timeout = 1500; + on-timeout = "loginctl lock-session"; + } + { + timeout = 330; # 5.5min + on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed + on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired. + } + { + timeout = 1800; + on-timeout = "systemctl suspend"; + } + ]; + }; + }; + }; +} diff --git a/hm/modules/linux/desktop-environment/hyprland/windowrulev2.nix b/hm/modules/linux/desktop-environment/hyprland/windowrulev2.nix new file mode 100644 index 0000000..d366ae7 --- /dev/null +++ b/hm/modules/linux/desktop-environment/hyprland/windowrulev2.nix @@ -0,0 +1,86 @@ +[ + "opacity 0.90 0.90,class:^(librewolf)$" + "opacity 0.90 0.90,class:^(floorp)$" + "opacity 0.90 0.90,class:^(zen-alpha)$" + "opacity 0.90 0.90,class:^(zen-beta)$" + "opacity 0.90 0.90,class:^(Brave-browser)$" + "opacity 0.80 0.80,class:^(Steam)$" + "opacity 0.80 0.80,class:^(steam)$" + "opacity 0.80 0.80,class:^(steamwebhelper)$" + "opacity 0.80 0.80,class:^(Spotify)$" + "opacity 0.80 0.80,initialTitle:^(Spotify Premium)$" + "opacity 0.80 0.80,initialTitle:^(Spotify Free)$" + "opacity 0.80 0.80,class:^(code-oss)$" + "opacity 0.80 0.80,class:^(Code)$" + "opacity 0.80 0.80,class:^(code-url-handler)$" + "opacity 0.80 0.80,class:^(code-insiders-url-handler)$" + "opacity 0.80 0.80,class:^(kitty)$" + "opacity 0.80 0.80,class:^(neovide)$" + "opacity 0.80 0.80,class:^(org.kde.dolphin)$" + "opacity 0.80 0.80,class:^(thunar)$" + "opacity 0.80 0.80,class:^(org.kde.ark)$" + "opacity 0.80 0.80,class:^(nwg-look)$" + "opacity 0.80 0.80,class:^(qt5ct)$" + "opacity 0.80 0.80,class:^(qt6ct)$" + "opacity 0.80 0.80,class:^(kvantummanager)$" + "opacity 0.80 0.80,class:^(waypaper)$" + "opacity 0.80 0.80,class:^(org.pulseaudio.pavucontrol)$" + "opacity 0.80 0.80,class:^(com.github.wwmm.easyeffects)$" + "opacity 0.80 0.80,class:^(thunderbird)$" + + "opacity 0.90 0.90,class:^(com.github.rafostar.Clapper)$ # Clapper-Gtk" + "opacity 0.80 0.80,class:^(com.github.tchx84.Flatseal)$ # Flatseal-Gtk" + "opacity 0.80 0.80,class:^(hu.kramo.Cartridges)$ # Cartridges-Gtk" + "opacity 0.80 0.80,class:^(com.obsproject.Studio)$ # Obs-Qt" + "opacity 0.80 0.80,class:^(gnome-boxes)$ # Boxes-Gtk" + "opacity 0.80 0.80,class:^(discord)$ # Discord-Electron" + "opacity 0.80 0.80,class:^(vesktop)$ # Vesktop-Electron" + "opacity 0.80 0.80,class:^(ArmCord)$ # ArmCord-Electron" + "opacity 0.80 0.80,class:^(app.drey.Warp)$ # Warp-Gtk" + "opacity 0.80 0.80,class:^(net.davidotek.pupgui2)$ # ProtonUp-Qt" + "opacity 0.80 0.80,class:^(yad)$ # Protontricks-Gtk" + "opacity 0.80 0.80,class:^(signal)$ # Signal-Gtk" + "opacity 0.80 0.80,class:^(io.github.alainm23.planify)$ # planify-Gtk" + "opacity 0.80 0.80,class:^(io.gitlab.theevilskeleton.Upscaler)$ # Upscaler-Gtk" + "opacity 0.80 0.80,class:^(com.github.unrud.VideoDownloader)$ # VideoDownloader-Gtk" + "opacity 0.80 0.80,class:^(lutris)$ # Lutris game launcher" + + "opacity 0.80 0.70,class:^(pavucontrol)$" + "opacity 0.80 0.70,class:^(blueman-manager)$" + "opacity 0.80 0.70,class:^(nm-applet)$" + "opacity 0.80 0.70,class:^(nm-connection-editor)$" + "opacity 0.80 0.70,class:^(org.kde.polkit-kde-authentication-agent-1)$" + + "float,class:^(org.kde.dolphin)$,title:^(Progress Dialog — Dolphin)$" + "float,class:^(org.kde.dolphin)$,title:^(Copying — Dolphin)$" + "float,title:^(Picture-in-Picture)$" + "float,class:^(librewolf)$,title:^(Library)$" + "float,class:^(floorp)$,title:^(Library)$" + "float,class:^(zen-alpha)$,title:^(Library)$" + "float,title:^(Extension: (Bitwarden Password Manager))$" + "float,class:^(vlc)$" + "float,class:^(kvantummanager)$" + "float,class:^(qt5ct)$" + "float,class:^(qt6ct)$" + "float,class:^(nwg-look)$" + "float,class:^(org.kde.ark)$" + "float,class:^(org.pulseaudio.pavucontrol)$" + "float,class:^(com.github.rafostar.Clapper)$ # Clapper-Gtk" + "float,class:^(app.drey.Warp)$ # Warp-Gtk" + "float,class:^(net.davidotek.pupgui2)$ # ProtonUp-Qt" + "float,class:^(yad)$ # Protontricks-Gtk" + "float,class:^(eog)$ # Imageviewer-Gtk" + "float,class:^(io.github.alainm23.planify)$ # planify-Gtk" + "float,class:^(io.gitlab.theevilskeleton.Upscaler)$ # Upscaler-Gtk" + "float,class:^(com.github.unrud.VideoDownloader)$ # VideoDownloader-Gkk" + "float,class:^(blueman-manager)$" + "float,class:^(nm-applet)$" + "float,class:^(nm-connection-editor)$" + "float,class:^(org.kde.polkit-kde-authentication-agent-1)$" + "opacity 0.80 0.80,class:^(org.freedesktop.impl.portal.desktop.gtk)$" + "opacity 0.80 0.80,class:^(org.freedesktop.impl.portal.desktop.hyprland)$" + + "size 50% 50%,class:^(org.pulseaudio.pavucontrol)" + + "stayfocused, class:^(pinentry-)" # fix pinentry losing focus +] diff --git a/hm/modules/linux/desktop-environment/swaync.nix b/hm/modules/linux/desktop-environment/swaync.nix new file mode 100644 index 0000000..73b1b3e --- /dev/null +++ b/hm/modules/linux/desktop-environment/swaync.nix @@ -0,0 +1,325 @@ +{ config, lib, ... }: +let + cfg = config.liminalOS.desktop.swaync; +in +{ + options.liminalOS.desktop.swaync = { + enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.desktop.enable; + description = '' + Whether to enable the swaync notification center and daemon. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + services.swaync.enable = true; + services.swaync.settings = { + positionX = "right"; + positionY = "top"; + control-center-margin-top = 10; + control-center-margin-bottom = 10; + control-center-margin-right = 10; + control-center-margin-left = 10; + notification-icon-size = 64; + notification-body-image-height = 100; + notification-body-image-width = 200; + timeout = 10; + timeout-low = 5; + timeout-critical = 0; + fit-to-screen = false; + control-center-width = 500; + control-center-height = 800; + notification-window-width = 500; + keyboard-shortcuts = true; + image-visibility = "when-available"; + transition-time = 200; + hide-on-clear = false; + hide-on-action = true; + script-fail-notify = true; + widgets = [ + "title" + "mpris" + "volume" + "backlight" + "dnd" + "notifications" + ]; + widget-config = { + title = { + text = "Mission Control"; + clear-all-button = "true"; + button-text = " All Systems Go"; + }; + dnd = { + text = "Do Not Disturb"; + }; + label = { + max-lines = 1; + text = "Mission Control"; + }; + mpris = { + image-size = 96; + image-radius = 7; + }; + volume = { + label = "󰕾"; + }; + backlight = { + label = "󰃟"; + }; + }; + }; + + home.file.".config/swaync/style.css".text = '' + * { + font-family: ${config.stylix.fonts.monospace.name}; + } + .control-center .notification-row:focus, + .control-center .notification-row:hover { + background: #${config.lib.stylix.colors.base00} + } + .notification-row { + outline: none; + margin: 10px; + padding: 0; + } + .notification { + background: transparent; + padding: 0; + margin: 0px; + opacity: 0.75; + } + .notification-content { + background: #${config.lib.stylix.colors.base00}; + padding: 10px; + border-radius: 5px; + border: 2px solid #${config.lib.stylix.colors.base05}; + margin: 0; + } + .notification-default-action { + margin: 0; + padding: 0; + border-radius: 5px; + } + .close-button { + background: #${config.lib.stylix.colors.base08}; + color: #${config.lib.stylix.colors.base00}; + text-shadow: none; + padding: 0; + border-radius: 5px; + margin-top: 5px; + margin-right: 5px; + } + .close-button:hover { + box-shadow: none; + background: #${config.lib.stylix.colors.base0D}; + transition: all .15s ease-in-out; + border: none + } + .notification-action { + border: 2px solid #${config.lib.stylix.colors.base0D}; + border-top: none; + border-radius: 5px; + } + .notification-default-action:hover, + .notification-action:hover { + color: #${config.lib.stylix.colors.base0B}; + background: #${config.lib.stylix.colors.base0B} + } + .notification-default-action { + border-radius: 5px; + margin: 0px; + } + .notification-default-action:not(:only-child) { + border-bottom-left-radius: 7px; + border-bottom-right-radius: 7px + } + .notification-action:first-child { + border-bottom-left-radius: 10px; + background: #${config.lib.stylix.colors.base00} + } + .notification-action:last-child { + border-bottom-right-radius: 10px; + background: #${config.lib.stylix.colors.base00} + } + .inline-reply { + margin-top: 8px + } + .inline-reply-entry { + background: #${config.lib.stylix.colors.base00}; + color: #${config.lib.stylix.colors.base05}; + caret-color: #${config.lib.stylix.colors.base05}; + border: 1px solid #${config.lib.stylix.colors.base09}; + border-radius: 5px + } + .inline-reply-button { + margin-left: 4px; + background: #${config.lib.stylix.colors.base00}; + border: 1px solid #${config.lib.stylix.colors.base09}; + border-radius: 5px; + color: #${config.lib.stylix.colors.base05} + } + .inline-reply-button:disabled { + background: initial; + color: #${config.lib.stylix.colors.base03}; + border: 1px solid transparent + } + .inline-reply-button:hover { + background: #${config.lib.stylix.colors.base00} + } + .body-image { + margin-top: 6px; + background-color: #${config.lib.stylix.colors.base05}; + border-radius: 5px + } + .summary { + font-size: 16px; + font-weight: 700; + background: transparent; + color: rgba(158, 206, 106, 1); + text-shadow: none + } + .time { + font-size: 16px; + font-weight: 700; + background: transparent; + color: #${config.lib.stylix.colors.base05}; + text-shadow: none; + margin-right: 18px + } + .body { + font-size: 15px; + font-weight: 400; + background: transparent; + color: #${config.lib.stylix.colors.base05}; + text-shadow: none + } + .control-center { + background: #${config.lib.stylix.colors.base00}; + border: 2px solid #${config.lib.stylix.colors.base0C}; + border-radius: 5px; + opacity: 0.85; + } + .control-center-list { + background: transparent + } + .control-center-list-placeholder { + opacity: .5 + } + .floating-notifications { + background: transparent + } + .blank-window { + background: alpha(black, 0) + } + .widget-title { + color: #${config.lib.stylix.colors.base0B}; + background: #${config.lib.stylix.colors.base00}; + padding: 5px 10px; + margin: 10px 10px 5px 10px; + font-size: 1.5rem; + border-radius: 5px; + } + .widget-title>button { + font-size: 1rem; + color: #${config.lib.stylix.colors.base05}; + text-shadow: none; + background: #${config.lib.stylix.colors.base00}; + box-shadow: none; + border-radius: 5px; + } + .widget-title>button:hover { + background: #${config.lib.stylix.colors.base08}; + color: #${config.lib.stylix.colors.base00}; + } + .widget-dnd { + background: #${config.lib.stylix.colors.base00}; + padding: 5px 10px; + margin: 10px 10px 5px 10px; + border-radius: 5px; + font-size: large; + color: #${config.lib.stylix.colors.base0B}; + } + .widget-dnd>switch { + border-radius: 5px; + /* border: 1px solid #${config.lib.stylix.colors.base0B}; */ + background: #${config.lib.stylix.colors.base0B}; + } + .widget-dnd>switch:checked { + background: #${config.lib.stylix.colors.base08}; + border: 1px solid #${config.lib.stylix.colors.base08}; + } + .widget-dnd>switch slider { + background: #${config.lib.stylix.colors.base00}; + border-radius: 5px + } + .widget-dnd>switch:checked slider { + background: #${config.lib.stylix.colors.base00}; + border-radius: 5px + } + .widget-label { + margin: 10px 10px 5px 10px; + } + .widget-label>label { + font-size: 1rem; + color: #${config.lib.stylix.colors.base05}; + } + .widget-mpris { + color: #${config.lib.stylix.colors.base05}; + padding: 5px 10px; + margin: 10px 10px 5px 10px; + border-radius: 5px; + } + .widget-mpris > box > button { + border-radius: 5px; + } + .widget-mpris-player { + padding: 5px 10px; + margin: 10px + } + .widget-mpris-title { + font-weight: 700; + font-size: 1.25rem + } + .widget-mpris-subtitle { + font-size: 1.1rem + } + .widget-menubar>box>.menu-button-bar>button { + border: none; + background: transparent + } + .topbar-buttons>button { + border: none; + background: transparent + } + .widget-volume { + background: #${config.lib.stylix.colors.base01}; + padding: 5px; + margin: 10px 10px 5px 10px; + border-radius: 5px; + font-size: x-large; + color: #${config.lib.stylix.colors.base05}; + } + .widget-volume>box>button { + background: #${config.lib.stylix.colors.base0B}; + border: none + } + .per-app-volume { + background-color: #${config.lib.stylix.colors.base00}; + padding: 4px 8px 8px; + margin: 0 8px 8px; + border-radius: 5px; + } + .widget-backlight { + background: #${config.lib.stylix.colors.base01}; + padding: 5px; + margin: 10px 10px 5px 10px; + border-radius: 5px; + font-size: x-large; + color: #${config.lib.stylix.colors.base05} + } + ''; + }; +} diff --git a/hm/modules/linux/desktop-environment/waybar/default.nix b/hm/modules/linux/desktop-environment/waybar/default.nix new file mode 100644 index 0000000..66aee10 --- /dev/null +++ b/hm/modules/linux/desktop-environment/waybar/default.nix @@ -0,0 +1,208 @@ +{ + pkgs, + osConfig, + config, + lib, + ... +}: +let + cfg = config.liminalOS.desktop.waybar; +in +{ + options.liminalOS.desktop.waybar = { + enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.desktop.enable; + description = '' + Whether to enable Waybar and the liminalOS rice. + ''; + }; + }; + + config = { + programs.waybar = lib.mkIf cfg.enable { + enable = true; + style = ./style.css; + systemd.enable = true; + settings = { + mainBar = { + name = "bar0"; + + layer = "top"; + position = "top"; + + height = 28; + + "margin" = "5px 10px 0px 10px"; + "spacing" = 10; + + "mode" = "top"; + + reload_style_on_change = true; + + modules-left = [ + "hyprland/workspaces" + "hyprland/window" + ]; + modules-right = [ + "tray" + "idle_inhibitor" + "backlight" + "wireplumber" + "network" + "battery" + "disk" + "memory" + "cpu" + "temperature" + "clock" + "custom/notification" + ]; + + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = "󰛊 "; + deactivated = "󰾫 "; + }; + }; + + network = { + format = "{ifname}"; + format-wifi = "{icon}{essid}"; + format-ethernet = " {essid}"; + format-disconnected = "󰤯 Disconnected"; + format-icons = [ + "󰤟 " + "󰤢 " + "󰤨 " + ]; + tooltip-format = " {bandwidthUpBits} |  {bandwidthDownBits}"; + tooltip-format-wifi = " {bandwidthUpBits} |  {bandwidthDownBits} | 󱄙 {signalStrength}"; + }; + + backlight = { + interval = 2; + format = "󰖨 {percent}%"; + on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl set +4"; + on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl set 4-"; + }; + + wireplumber = { + format = "{icon} {volume}%"; + format-muted = "󰝟 "; + on-click = "pamixer -t"; + on-scroll-up = "${pkgs.pamixer}/bin/pamixer set 5%+"; + on-scroll-down = "${pkgs.pamixer}/bin/pamixer set 5%-"; + format-icons = [ + "" + "" + "" + "" + "" + ]; + }; + + battery = { + interval = 10; + format = "{icon} {capacity}%"; + format-icons = [ + "󰂎" + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + tooltip = true; + tooltip-format = "{timeTo}"; + }; + + disk = { + intervel = 30; + format = "󰋊 {percentage_used}%"; + tooltip-format = "{used} used out of {total} on \"{path}\" ({percentage_used}%)"; + }; + + memory = { + interval = 10; + format = " {used}"; + tooltip-format = "{used}GiB used of {total}GiB ({percentage}%)"; + }; + + cpu = { + interval = 10; + format = " {usage}%"; + }; + + temperature = { + interval = 10; + }; + + clock = { + interval = 1; + format = "{:%H:%M:%S}"; + }; + + "custom/notification" = lib.mkIf config.liminalOS.desktop.swaync.enable { + tooltip = false; + format = "{icon}"; + format-icons = { + notification = ""; + none = " "; + dnd-notification = ""; + dnd-none = " "; + }; + return-type = "json"; + exec = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb"; + on-click = "sleep 0.1 && ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw"; + on-click-right = "sleep 0.1 && ${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw"; + escape = true; + }; + + "hyprland/workspaces" = { + show-special = true; + persistent-workspaces = { + "*" = [ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + ]; + }; + format = "{icon}"; + format-icons = { + active = ""; + empty = ""; + default = ""; + urgent = ""; + special = "󰠱"; + }; + }; + + "hyprland/window" = { + icon = true; + icon-size = 20; + max-length = 50; + rewrite = { + "(.*) — LibreWolf" = "$1"; + "(.*) — Zen Browser" = "$1"; + "^$" = "👾"; + }; + }; + }; + }; + }; + }; +} diff --git a/hm/modules/linux/desktop-environment/waybar/desktop/default.nix b/hm/modules/linux/desktop-environment/waybar/desktop/default.nix new file mode 100644 index 0000000..731f793 --- /dev/null +++ b/hm/modules/linux/desktop-environment/waybar/desktop/default.nix @@ -0,0 +1,171 @@ +{ + # home.file.".config/waybar/config".source = ./config.jsonc; + programs.waybar = { + enable = true; + style = ./style.css; + systemd.enable = true; + settings = { + mainBar = { + name = "bar0"; + + layer = "top"; + position = "top"; + + height = 28; + # "width" = 1920; + + "margin" = "5px 10px 0px 10px"; + "spacing" = 10; + + "mode" = "top"; + # "exclusive" = true; + + # "output" = "eDP-1"; + + reload_style_on_change = true; + + modules-left = [ "hyprland/workspaces" ]; + modules-center = [ "hyprland/window" ]; + modules-right = [ + "tray" + "idle_inhibitor" + "backlight" + "wireplumber" + "network" + "battery" + "disk" + "memory" + "cpu" + "temperature" + "clock" + ]; + + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = "󰛊 "; + deactivated = "󰾫 "; + }; + }; + + network = { + format = "{ifname}"; + format-wifi = "{icon}{essid}"; + format-ethernet = " {essid}"; + format-disconnected = "󰤯 Disconnected"; + format-icons = [ + "󰤟 " + "󰤢 " + "󰤨 " + ]; + tooltip-format = " {bandwidthUpBits} |  {bandwidthDownBits}"; + tooltip-format-wifi = " {bandwidthUpBits} |  {bandwidthDownBits} | 󱄙 {signalStrength}"; + }; + + backlight = { + interval = 2; + format = "󰖨 {percent}%"; + on-scroll-up = "brightnessctl set +4"; + on-scroll-down = "brightnessctl set 4-"; + }; + + wireplumber = { + format = "{icon} {volume}%"; + format-muted = "󰝟 "; + on-click = "pamixer -t"; + on-scroll-up = "pamixer set 5%+"; + on-scroll-down = "pamixer set 5%-"; + format-icons = [ + "" + "" + "" + "" + "" + ]; + }; + + battery = { + interval = 10; + format = "{icon}{capacity}%"; + format-icons = [ + "󰂎" + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + tooltip = true; + tooltip-format = "{timeTo}"; + }; + + disk = { + intervel = 30; + format = "󰋊 {percentage_used}%"; + tooltip-format = "{used} used out of {total} on \"{path}\" ({percentage_used}%)"; + }; + + memory = { + interval = 10; + format = " {used}"; + tooltip-format = "{used}GiB used of {total}GiB ({percentage}%)"; + }; + + cpu = { + interval = 10; + format = " {usage}%"; + }; + + temperature = { + interval = 10; + }; + + clock = { + interval = 1; + format = "{:%H:%M:%S}"; + }; + + "hyprland/workspaces" = { + show-special = true; + persistent-workspaces = { + "*" = [ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + ]; + }; + format = "{icon}"; + format-icons = { + active = ""; + empty = ""; + default = ""; + urgent = ""; + special = "󰠱"; + }; + }; + "hyprland/window" = { + icon = true; + icon-size = 20; + max-length = 50; + rewrite = { + "(.*) — Ablaze Floorp" = "$1"; + "(.*) — Zen Browser" = "$1"; + "^$" = "👾"; + }; + }; + }; + }; + }; +} diff --git a/hm/modules/linux/desktop-environment/waybar/desktop/style.css b/hm/modules/linux/desktop-environment/waybar/desktop/style.css new file mode 100644 index 0000000..0307cdf --- /dev/null +++ b/hm/modules/linux/desktop-environment/waybar/desktop/style.css @@ -0,0 +1,71 @@ +window#waybar { + font-family: "CaskaydiaCove Nerd Font"; + background-color: rgba(0,0,0,0); + font-size: 0.8rem; + border-radius: 0.5rem; +} + +.modules-left, .modules-center { + opacity: 1; + background: linear-gradient(45deg, rgb(214, 39, 200), rgb(5, 83, 252)); + border-radius: 0.5rem; + padding: 2px; +} + +.modules-right { + opacity: 1; + background-color: rgba(0,0,0,0.5); + border-radius: 0.5rem; + padding: 2px 2px 2px 10px +} + +/* label.module { + margin-left: -1px; +} */ + +#workspaces { + background-color: rgba(0,0,0,0.5); + border-radius: 0.5rem; + padding: 0 2px; +} + +#workspaces button { + font-size: 0.6rem; + padding: 0 0.3rem 0 0; +} + +#window { + background-color: rgba(0,0,0,0.5); + border-radius: 0.5rem; + padding: 2px 5px; +} + +#clock { + font-weight: bolder; + border-radius: 0.5rem; + padding: 0 3px 0 0; +} + +#battery { + color: lightgreen; +} + +#memory { + color: lightpink; +} + +#disk { + color: lightskyblue; +} + +#cpu { + color: lightgoldenrodyellow; +} + +#temperature { + color: lightslategray; +} + +#network { + color: lightsteelblue; +} diff --git a/hm/modules/linux/desktop-environment/waybar/style.css b/hm/modules/linux/desktop-environment/waybar/style.css new file mode 100644 index 0000000..9a4ef6e --- /dev/null +++ b/hm/modules/linux/desktop-environment/waybar/style.css @@ -0,0 +1,78 @@ +window#waybar { + font-family: "CaskaydiaCove Nerd Font"; + background-color: rgba(0,0,0,0); + font-size: 0.8rem; + border-radius: 0.5rem; + color: #cccccc; +} + +.modules-left { + opacity: 1; + background: linear-gradient(45deg, rgb(214, 39, 200), rgb(5, 83, 252)); + border-radius: 0.5rem; + padding: 2px; +} + +.modules-center { + opacity: 0; +} + +.modules-right { + opacity: 1; + background-color: rgba(0,0,0,0.5); + border-radius: 0.5rem; + padding: 2px 2px 2px 10px +} + +/* label.module { + margin-left: -1px; +} */ + +#workspaces { + background-color: rgba(0,0,0,0.5); + border-radius: 0.5rem; + padding: 0 2px; +} + +#workspaces button { + font-size: 0.6rem; + padding: 0 0.3rem 0 0; + border: #cccccc; + color: #cccccc; +} + +#window { + background-color: rgba(0,0,0,0.5); + border-radius: 0.5rem; + padding: 2px 5px; +} + +#clock { + font-weight: bolder; + border-radius: 0.5rem; + padding: 0 3px 0 0; +} + +#battery { + color: lightgreen; +} + +#memory { + color: lightpink; +} + +#disk { + color: lightskyblue; +} + +#cpu { + color: lightgoldenrodyellow; +} + +#temperature { + color: lightslategray; +} + +#network { + color: lightsteelblue; +} diff --git a/hm/modules/linux/platform-tweaks/default.nix b/hm/modules/linux/platform-tweaks/default.nix new file mode 100644 index 0000000..f3ab7e4 --- /dev/null +++ b/hm/modules/linux/platform-tweaks/default.nix @@ -0,0 +1,35 @@ +{ + inputs, + lib, + config, + osConfig, + ... +}: +let + cfg = config.liminalOS; +in +{ + options.liminalOS = { + formFactor = lib.mkOption { + type = lib.types.nullOr ( + lib.types.enum [ + "laptop" + "desktop" + ] + ); + default = osConfig.liminalOS.formFactor; + description = '' + Form factor of the machine. Adjusts some UI features. Inherited from system configuration liminalOS.formFactor if set, otherwise you must set it here. + ''; + }; + }; + + config = { + assertions = [ + { + assertion = cfg.formFactor != null; + message = "You must set liminalOS.formFactor either in the home-manager configuration for the user or in the OS configuration for the system!"; + } + ]; + }; +} diff --git a/hm/modules/linux/programs/bulk-programs.nix b/hm/modules/linux/programs/bulk-programs.nix new file mode 100644 index 0000000..901359e --- /dev/null +++ b/hm/modules/linux/programs/bulk-programs.nix @@ -0,0 +1,88 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.liminalOS.programs.bulk; + mkEnableOption' = + desc: + lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to enable ${desc}. + ''; + }; +in +{ + options.liminalOS.programs.bulk = { + enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.programs.enable; + description = '' + Whether to enable installation of various useful programs in the system. + ''; + }; + archiveTools.enable = mkEnableOption' "archive tools"; + instantMessaging.enable = mkEnableOption' "instant messengers"; + nixCliTools.enable = mkEnableOption' "Nix CLI helper tools and utilities"; + desktopApps.enable = mkEnableOption' "desktop applications like mail and file explorer"; + misc.enable = mkEnableOption' "assorted uncategorized utilities"; + }; + + config = lib.mkIf cfg.enable { + home.packages = + lib.optionals cfg.archiveTools.enable ( + with pkgs; + [ + zip + xz + unzip + p7zip + ] + ) + ++ lib.optionals cfg.nixCliTools.enable ( + with pkgs; + [ + nurl + nix-output-monitor + ] + ) + ++ lib.optionals cfg.misc.enable ( + with pkgs; + [ + ffmpeg + + pciutils # lspci + usbutils # lsusb + + ani-cli + manga-tui + + hledger + ] + ) + ++ lib.optionals cfg.instantMessaging.enable ( + with pkgs; + [ + vesktop + signal-desktop + iamb + ] + ++ lib.optionals cfg.desktopApps.enable ( + with pkgs; + [ + thunderbird + xfce.thunar + ] + ++ lib.optionals pkgs.stdenv.targetPlatform.isx86_64 [ + bitwarden-desktop + sbctl + ] + ++ lib.optionals pkgs.stdenv.targetPlatform.isAarch64 [ ] + ) + ); + }; +} diff --git a/hm/modules/linux/programs/default.nix b/hm/modules/linux/programs/default.nix new file mode 100644 index 0000000..961a43f --- /dev/null +++ b/hm/modules/linux/programs/default.nix @@ -0,0 +1,95 @@ +{ + pkgs, + inputs, + config, + lib, + ... +}: +let + cfg = config.liminalOS.programs; +in +{ + imports = [ + ./bulk-programs.nix + ]; + + options.liminalOS.programs = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to set up many default desktop programs. + ''; + }; + terminal.enable = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to set up kitty terminal. + ''; + }; + zen.enable = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to install Zen Browser and set it as the default browser. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + programs.kitty = lib.mkIf cfg.terminal.enable { + enable = true; + font.name = "CaskaydiaCove Nerd Font"; + shellIntegration.enableFishIntegration = true; + shellIntegration.enableBashIntegration = true; + settings = { + font_size = 11; + window_padding_width = "8 8"; + confirm_os_window_close = -1; + enable_audio_bell = "no"; + background_opacity = pkgs.lib.mkForce "0.8"; + allow_remote_control = "yes"; + listen_on = "unix:/tmp/kitty"; + scrollback_pager = ''nvim --noplugin -c "set signcolumn=no showtabline=0" -c "silent write! /tmp/kitty_scrollback_buffer | te cat /tmp/kitty_scrollback_buffer - "''; + cursor = pkgs.lib.mkForce "#c0caf5"; + cursor_text_color = pkgs.lib.mkForce "#1a1b26"; + cursor_trail = 3; + }; + keybindings = { + "kitty_mod+h" = "show_scrollback"; + }; + }; + + programs.spotify-player.enable = true; + + programs.neovide = { + enable = false; + settings = { + font = { + normal = [ "CaskaydiaCove Nerd Font" ]; + size = if config.liminalOS.formFactor == "laptop" then 11 else 13; + }; + }; + }; + + xdg.mimeApps = lib.mkIf cfg.zen.enable { + enable = true; + defaultApplications = { + "text/html" = [ "zen.desktop" ]; + "x-scheme-handler/http" = [ "zen.desktop" ]; + "x-scheme-handler/https" = [ "zen.desktop" ]; + "x-scheme-handler/about" = [ "zen.desktop" ]; + "x-scheme-handler/unknown" = [ "zen.desktop" ]; + }; + }; + + home.packages = lib.mkIf cfg.zen.enable [ + inputs.zen-browser.packages.${pkgs.system}.default + ]; + + home.sessionVariables.DEFAULT_BROWSER = lib.mkIf cfg.zen.enable "${ + inputs.zen-browser.packages.${pkgs.system}.default + }/bin/zen"; + }; +} diff --git a/hm/modules/linux/spicetify/default.nix b/hm/modules/linux/spicetify/default.nix new file mode 100644 index 0000000..985397e --- /dev/null +++ b/hm/modules/linux/spicetify/default.nix @@ -0,0 +1,31 @@ +{ + inputs, + pkgs, + config, + osConfig, + lib, + ... +}: +let + spicepkgs = inputs.spicetify.legacyPackages.${pkgs.system}; +in +{ + imports = [ + inputs.spicetify.homeManagerModules.default + ]; + + config = lib.mkIf (config.liminalOS.programs.enable && osConfig.liminalOS.config.allowUnfree) { + programs.spicetify = { + enable = true; + # theme = spicepkgs.themes.dribbblish; + # colorScheme = "rosepine"; + enabledExtensions = with spicepkgs.extensions; [ + lastfm + fullAppDisplayMod + ]; + enabledCustomApps = with spicepkgs.apps; [ + lyricsPlus + ]; + }; + }; +} diff --git a/hm/modules/linux/theming/default.nix b/hm/modules/linux/theming/default.nix new file mode 100644 index 0000000..7d3539e --- /dev/null +++ b/hm/modules/linux/theming/default.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + imports = [ ./stylix.nix ]; + # gtk = { + # enable = true; + # cursorTheme = { + # name = "Bibata-Modern-Ice"; + # size = 26; + # }; + # iconTheme = { + # name = "Papirus-Dark"; + # }; + # }; +} diff --git a/hm/modules/linux/theming/stylix.nix b/hm/modules/linux/theming/stylix.nix new file mode 100644 index 0000000..94ee4a9 --- /dev/null +++ b/hm/modules/linux/theming/stylix.nix @@ -0,0 +1,13 @@ +{ osConfig, lib, ... }: +{ + config.stylix.targets = lib.mkIf osConfig.liminalOS.theming.enable { + waybar.enable = false; + kitty.variant256Colors = true; + neovim.enable = false; + kde.enable = true; + gnome.enable = true; + swaync.enable = false; + hyprlock.enable = false; + hyprland.enable = false; + }; +} diff --git a/hm/modules/linux/var/easyeffects/default.nix b/hm/modules/linux/var/easyeffects/default.nix new file mode 100644 index 0000000..00764d3 --- /dev/null +++ b/hm/modules/linux/var/easyeffects/default.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + osConfig, + ... +}: +let + cfg = config.liminalOS.utils.easyeffects; +in +{ + options.liminalOS.utils.easyeffects = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to enable EasyEffects. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + services.easyeffects.enable = true; + + home.file = lib.mkIf (osConfig.liminalOS.flakeLocation != null) { + ".config/easyeffects/output" = { + source = config.lib.file.mkOutOfStoreSymlink "${osConfig.liminalOS.flakeLocation}/hm/modules/linux/var/easyeffects/output"; + recursive = true; + }; + ".config/easyeffects/input" = { + source = config.lib.file.mkOutOfStoreSymlink "${osConfig.liminalOS.flakeLocation}/hm/modules/linux/var/easyeffects/input"; + recursive = true; + }; + }; + }; +} diff --git a/hm/modules/linux/var/easyeffects/input/Default.json b/hm/modules/linux/var/easyeffects/input/Default.json new file mode 100644 index 0000000..60b5635 --- /dev/null +++ b/hm/modules/linux/var/easyeffects/input/Default.json @@ -0,0 +1,75 @@ +{ + "input": { + "blocklist": [], + "compressor#0": { + "attack": 20.0, + "boost-amount": 6.0, + "boost-threshold": -72.0, + "bypass": true, + "dry": -100.0, + "hpf-frequency": 10.0, + "hpf-mode": "off", + "input-gain": 0.0, + "knee": -6.0, + "lpf-frequency": 20000.0, + "lpf-mode": "off", + "makeup": 0.0, + "mode": "Downward", + "output-gain": 0.0, + "ratio": 4.0, + "release": 100.0, + "release-threshold": -100.0, + "sidechain": { + "lookahead": 0.0, + "mode": "RMS", + "preamp": 0.0, + "reactivity": 10.0, + "source": "Middle", + "stereo-split-source": "Left/Right", + "type": "Feed-forward" + }, + "stereo-split": false, + "threshold": -12.0, + "wet": 0.0 + }, + "limiter#0": { + "alr": false, + "alr-attack": 5.0, + "alr-knee": 0.0, + "alr-release": 50.0, + "attack": 5.0, + "bypass": true, + "dithering": "None", + "external-sidechain": false, + "gain-boost": true, + "input-gain": 0.0, + "lookahead": 5.0, + "mode": "Herm Thin", + "output-gain": 0.0, + "oversampling": "None", + "release": 5.0, + "sidechain-preamp": 0.0, + "stereo-link": 100.0, + "threshold": 0.0 + }, + "plugins_order": [ + "limiter#0", + "compressor#0", + "reverb#0" + ], + "reverb#0": { + "amount": -12.0, + "bass-cut": 300.0, + "bypass": true, + "decay-time": 1.5, + "diffusion": 0.5, + "dry": 0.0, + "hf-damp": 5000.0, + "input-gain": 0.0, + "output-gain": 0.0, + "predelay": 0.0, + "room-size": "Large", + "treble-cut": 5000.0 + } + } +} diff --git a/hm/modules/linux/var/easyeffects/input/Studio.json b/hm/modules/linux/var/easyeffects/input/Studio.json new file mode 100644 index 0000000..f05bb2d --- /dev/null +++ b/hm/modules/linux/var/easyeffects/input/Studio.json @@ -0,0 +1,75 @@ +{ + "input": { + "blocklist": [], + "compressor#0": { + "attack": 20.0, + "boost-amount": 6.0, + "boost-threshold": -72.0, + "bypass": false, + "dry": -100.0, + "hpf-frequency": 10.0, + "hpf-mode": "off", + "input-gain": 0.0, + "knee": -6.0, + "lpf-frequency": 20000.0, + "lpf-mode": "off", + "makeup": 0.0, + "mode": "Downward", + "output-gain": -2.1, + "ratio": 4.0, + "release": 100.0, + "release-threshold": -100.0, + "sidechain": { + "lookahead": 0.0, + "mode": "RMS", + "preamp": 0.0, + "reactivity": 10.0, + "source": "Middle", + "stereo-split-source": "Left/Right", + "type": "Feed-forward" + }, + "stereo-split": false, + "threshold": -12.0, + "wet": 0.0 + }, + "limiter#0": { + "alr": false, + "alr-attack": 5.0, + "alr-knee": 0.0, + "alr-release": 50.0, + "attack": 5.0, + "bypass": false, + "dithering": "None", + "external-sidechain": false, + "gain-boost": true, + "input-gain": 0.0, + "lookahead": 5.0, + "mode": "Herm Thin", + "output-gain": 0.0, + "oversampling": "None", + "release": 5.0, + "sidechain-preamp": 0.0, + "stereo-link": 100.0, + "threshold": 0.0 + }, + "plugins_order": [ + "limiter#0", + "speex#0", + "compressor#0" + ], + "speex#0": { + "bypass": false, + "enable-agc": true, + "enable-denoise": true, + "enable-dereverb": false, + "input-gain": 0.0, + "noise-suppression": -70, + "output-gain": 0.0, + "vad": { + "enable": true, + "probability-continue": 90, + "probability-start": 95 + } + } + } +} diff --git a/hm/modules/linux/var/easyeffects/output/AirPods Pro ANC.json b/hm/modules/linux/var/easyeffects/output/AirPods Pro ANC.json new file mode 100644 index 0000000..73a2624 --- /dev/null +++ b/hm/modules/linux/var/easyeffects/output/AirPods Pro ANC.json @@ -0,0 +1,243 @@ +{ + "output": { + "blocklist": [], + "equalizer#0": { + "balance": 0.0, + "bypass": false, + "input-gain": -3.68, + "left": { + "band0": { + "frequency": 105.0, + "gain": 0.6000000238418579, + "mode": "APO (DR)", + "mute": false, + "q": 0.6666666865348816, + "slope": "x1", + "solo": false, + "type": "Lo-shelf", + "width": 4.0 + }, + "band1": { + "frequency": 27.100000381469727, + "gain": -0.30000001192092896, + "mode": "APO (DR)", + "mute": false, + "q": 2.7300000190734863, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band2": { + "frequency": 79.0, + "gain": 1.7999999523162842, + "mode": "APO (DR)", + "mute": false, + "q": 1.2300000190734863, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band3": { + "frequency": 474.8999938964844, + "gain": -2.5, + "mode": "APO (DR)", + "mute": false, + "q": 0.5400000214576721, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band4": { + "frequency": 1164.199951171875, + "gain": 2.0, + "mode": "APO (DR)", + "mute": false, + "q": 3.119999885559082, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band5": { + "frequency": 2344.60009765625, + "gain": 2.0, + "mode": "APO (DR)", + "mute": false, + "q": 3.0899999141693115, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band6": { + "frequency": 5148.0, + "gain": 3.9000000953674316, + "mode": "APO (DR)", + "mute": false, + "q": 1.6100000143051147, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band7": { + "frequency": 6457.60009765625, + "gain": -5.0, + "mode": "APO (DR)", + "mute": false, + "q": 6.0, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band8": { + "frequency": 9619.900390625, + "gain": 3.799999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 2.309999942779541, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band9": { + "frequency": 10000.0, + "gain": -2.299999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 0.6666666865348816, + "slope": "x1", + "solo": false, + "type": "Hi-shelf", + "width": 4.0 + } + }, + "mode": "IIR", + "num-bands": 10, + "output-gain": 0.0, + "pitch-left": 0.0, + "pitch-right": 0.0, + "right": { + "band0": { + "frequency": 105.0, + "gain": 0.6000000238418579, + "mode": "APO (DR)", + "mute": false, + "q": 0.6666666865348816, + "slope": "x1", + "solo": false, + "type": "Lo-shelf", + "width": 4.0 + }, + "band1": { + "frequency": 27.100000381469727, + "gain": -0.30000001192092896, + "mode": "APO (DR)", + "mute": false, + "q": 2.7300000190734863, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band2": { + "frequency": 79.0, + "gain": 1.7999999523162842, + "mode": "APO (DR)", + "mute": false, + "q": 1.2300000190734863, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band3": { + "frequency": 474.8999938964844, + "gain": -2.5, + "mode": "APO (DR)", + "mute": false, + "q": 0.5400000214576721, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band4": { + "frequency": 1164.199951171875, + "gain": 2.0, + "mode": "APO (DR)", + "mute": false, + "q": 3.119999885559082, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band5": { + "frequency": 2344.60009765625, + "gain": 2.0, + "mode": "APO (DR)", + "mute": false, + "q": 3.0899999141693115, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band6": { + "frequency": 5148.0, + "gain": 3.9000000953674316, + "mode": "APO (DR)", + "mute": false, + "q": 1.6100000143051147, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band7": { + "frequency": 6457.60009765625, + "gain": -5.0, + "mode": "APO (DR)", + "mute": false, + "q": 6.0, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band8": { + "frequency": 9619.900390625, + "gain": 3.799999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 2.309999942779541, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band9": { + "frequency": 10000.0, + "gain": -2.299999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 0.6666666865348816, + "slope": "x1", + "solo": false, + "type": "Hi-shelf", + "width": 4.0 + } + }, + "split-channels": false + }, + "plugins_order": [ + "equalizer#0" + ] + } +} diff --git a/hm/modules/linux/var/easyeffects/output/AirPods Pro Transparency.json b/hm/modules/linux/var/easyeffects/output/AirPods Pro Transparency.json new file mode 100644 index 0000000..ae46b48 --- /dev/null +++ b/hm/modules/linux/var/easyeffects/output/AirPods Pro Transparency.json @@ -0,0 +1,243 @@ +{ + "output": { + "blocklist": [], + "equalizer#0": { + "balance": 0.0, + "bypass": false, + "input-gain": -3.34, + "left": { + "band0": { + "frequency": 105.0, + "gain": 0.699999988079071, + "mode": "APO (DR)", + "mute": false, + "q": 0.6666666865348816, + "slope": "x1", + "solo": false, + "type": "Lo-shelf", + "width": 4.0 + }, + "band1": { + "frequency": 26.5, + "gain": -0.4000000059604645, + "mode": "APO (DR)", + "mute": false, + "q": 2.380000114440918, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band2": { + "frequency": 79.19999694824219, + "gain": 1.600000023841858, + "mode": "APO (DR)", + "mute": false, + "q": 1.2999999523162842, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band3": { + "frequency": 468.0, + "gain": -2.5, + "mode": "APO (DR)", + "mute": false, + "q": 0.5400000214576721, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band4": { + "frequency": 1152.699951171875, + "gain": 1.899999976158142, + "mode": "APO (DR)", + "mute": false, + "q": 2.890000104904175, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band5": { + "frequency": 2310.800048828125, + "gain": 1.7999999523162842, + "mode": "APO (DR)", + "mute": false, + "q": 2.569999933242798, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band6": { + "frequency": 5148.7001953125, + "gain": 3.5, + "mode": "APO (DR)", + "mute": false, + "q": 1.4700000286102295, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band7": { + "frequency": 6472.39990234375, + "gain": -4.599999904632568, + "mode": "APO (DR)", + "mute": false, + "q": 6.0, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band8": { + "frequency": 9526.5, + "gain": 3.700000047683716, + "mode": "APO (DR)", + "mute": false, + "q": 2.25, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band9": { + "frequency": 10000.0, + "gain": -2.299999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 0.6666666865348816, + "slope": "x1", + "solo": false, + "type": "Hi-shelf", + "width": 4.0 + } + }, + "mode": "IIR", + "num-bands": 10, + "output-gain": 0.0, + "pitch-left": 0.0, + "pitch-right": 0.0, + "right": { + "band0": { + "frequency": 105.0, + "gain": 0.699999988079071, + "mode": "APO (DR)", + "mute": false, + "q": 0.6666666865348816, + "slope": "x1", + "solo": false, + "type": "Lo-shelf", + "width": 4.0 + }, + "band1": { + "frequency": 26.5, + "gain": -0.4000000059604645, + "mode": "APO (DR)", + "mute": false, + "q": 2.380000114440918, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band2": { + "frequency": 79.19999694824219, + "gain": 1.600000023841858, + "mode": "APO (DR)", + "mute": false, + "q": 1.2999999523162842, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band3": { + "frequency": 468.0, + "gain": -2.5, + "mode": "APO (DR)", + "mute": false, + "q": 0.5400000214576721, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band4": { + "frequency": 1152.699951171875, + "gain": 1.899999976158142, + "mode": "APO (DR)", + "mute": false, + "q": 2.890000104904175, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band5": { + "frequency": 2310.800048828125, + "gain": 1.7999999523162842, + "mode": "APO (DR)", + "mute": false, + "q": 2.569999933242798, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band6": { + "frequency": 5148.7001953125, + "gain": 3.5, + "mode": "APO (DR)", + "mute": false, + "q": 1.4700000286102295, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band7": { + "frequency": 6472.39990234375, + "gain": -4.599999904632568, + "mode": "APO (DR)", + "mute": false, + "q": 6.0, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band8": { + "frequency": 9526.5, + "gain": 3.700000047683716, + "mode": "APO (DR)", + "mute": false, + "q": 2.25, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band9": { + "frequency": 10000.0, + "gain": -2.299999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 0.6666666865348816, + "slope": "x1", + "solo": false, + "type": "Hi-shelf", + "width": 4.0 + } + }, + "split-channels": false + }, + "plugins_order": [ + "equalizer#0" + ] + } +} diff --git a/hm/modules/linux/var/easyeffects/output/Arctis Pro EQ.json b/hm/modules/linux/var/easyeffects/output/Arctis Pro EQ.json new file mode 100644 index 0000000..3f774c8 --- /dev/null +++ b/hm/modules/linux/var/easyeffects/output/Arctis Pro EQ.json @@ -0,0 +1,243 @@ +{ + "output": { + "blocklist": [], + "equalizer#0": { + "balance": 0.0, + "bypass": false, + "input-gain": -8.61, + "left": { + "band0": { + "frequency": 105.0, + "gain": -0.6000000238418579, + "mode": "APO (DR)", + "mute": false, + "q": 0.699999988079071, + "slope": "x1", + "solo": false, + "type": "Lo-shelf", + "width": 4.0 + }, + "band1": { + "frequency": 50.0, + "gain": 3.9000000953674316, + "mode": "APO (DR)", + "mute": false, + "q": 2.0399999618530273, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band2": { + "frequency": 135.6999969482422, + "gain": -1.5, + "mode": "APO (DR)", + "mute": false, + "q": 1.149999976158142, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band3": { + "frequency": 361.3999938964844, + "gain": 3.0999999046325684, + "mode": "APO (DR)", + "mute": false, + "q": 1.159999966621399, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band4": { + "frequency": 1135.300048828125, + "gain": -4.599999904632568, + "mode": "APO (DR)", + "mute": false, + "q": 1.2200000286102295, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band5": { + "frequency": 2703.699951171875, + "gain": -3.799999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 2.799999952316284, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band6": { + "frequency": 3766.800048828125, + "gain": 9.399999618530273, + "mode": "APO (DR)", + "mute": false, + "q": 1.8300000429153442, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band7": { + "frequency": 5260.39990234375, + "gain": 5.0, + "mode": "APO (DR)", + "mute": false, + "q": 3.609999895095825, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band8": { + "frequency": 8775.2998046875, + "gain": -7.400000095367432, + "mode": "APO (DR)", + "mute": false, + "q": 1.75, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band9": { + "frequency": 10000.0, + "gain": -2.299999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 0.699999988079071, + "slope": "x1", + "solo": false, + "type": "Hi-shelf", + "width": 4.0 + } + }, + "mode": "IIR", + "num-bands": 10, + "output-gain": 3.9, + "pitch-left": 0.0, + "pitch-right": 0.0, + "right": { + "band0": { + "frequency": 105.0, + "gain": -0.6000000238418579, + "mode": "APO (DR)", + "mute": false, + "q": 0.699999988079071, + "slope": "x1", + "solo": false, + "type": "Lo-shelf", + "width": 4.0 + }, + "band1": { + "frequency": 50.0, + "gain": 3.9000000953674316, + "mode": "APO (DR)", + "mute": false, + "q": 2.0399999618530273, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band2": { + "frequency": 135.6999969482422, + "gain": -1.5, + "mode": "APO (DR)", + "mute": false, + "q": 1.149999976158142, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band3": { + "frequency": 361.3999938964844, + "gain": 3.0999999046325684, + "mode": "APO (DR)", + "mute": false, + "q": 1.159999966621399, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band4": { + "frequency": 1135.300048828125, + "gain": -4.599999904632568, + "mode": "APO (DR)", + "mute": false, + "q": 1.2200000286102295, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band5": { + "frequency": 2703.699951171875, + "gain": -3.799999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 2.799999952316284, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band6": { + "frequency": 3766.800048828125, + "gain": 9.399999618530273, + "mode": "APO (DR)", + "mute": false, + "q": 1.8300000429153442, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band7": { + "frequency": 5260.39990234375, + "gain": 5.0, + "mode": "APO (DR)", + "mute": false, + "q": 3.609999895095825, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band8": { + "frequency": 8775.2998046875, + "gain": -7.400000095367432, + "mode": "APO (DR)", + "mute": false, + "q": 1.75, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band9": { + "frequency": 10000.0, + "gain": -2.299999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 0.699999988079071, + "slope": "x1", + "solo": false, + "type": "Hi-shelf", + "width": 4.0 + } + }, + "split-channels": false + }, + "plugins_order": [ + "equalizer#0" + ] + } +} diff --git a/hm/modules/linux/var/easyeffects/output/DT770 Pro.json b/hm/modules/linux/var/easyeffects/output/DT770 Pro.json new file mode 100644 index 0000000..d30f198 --- /dev/null +++ b/hm/modules/linux/var/easyeffects/output/DT770 Pro.json @@ -0,0 +1,243 @@ +{ + "output": { + "blocklist": [], + "equalizer#0": { + "balance": 0.0, + "bypass": false, + "input-gain": -4.74, + "left": { + "band0": { + "frequency": 105.0, + "gain": 3.0, + "mode": "APO (DR)", + "mute": false, + "q": 0.6666666865348816, + "slope": "x1", + "solo": false, + "type": "Lo-shelf", + "width": 4.0 + }, + "band1": { + "frequency": 53.5, + "gain": -6.800000190734863, + "mode": "APO (DR)", + "mute": false, + "q": 0.699999988079071, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band2": { + "frequency": 141.89999389648438, + "gain": -2.4000000953674316, + "mode": "APO (DR)", + "mute": false, + "q": 2.7699999809265137, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band3": { + "frequency": 199.89999389648438, + "gain": 6.0, + "mode": "APO (DR)", + "mute": false, + "q": 2.5, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band4": { + "frequency": 943.5, + "gain": -1.399999976158142, + "mode": "APO (DR)", + "mute": false, + "q": 3.5, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band5": { + "frequency": 2352.89990234375, + "gain": -1.5, + "mode": "APO (DR)", + "mute": false, + "q": 3.440000057220459, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band6": { + "frequency": 3523.5, + "gain": 4.800000190734863, + "mode": "APO (DR)", + "mute": false, + "q": 3.859999895095825, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band7": { + "frequency": 5082.7001953125, + "gain": -3.5, + "mode": "APO (DR)", + "mute": false, + "q": 4.53000020980835, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band8": { + "frequency": 6828.10009765625, + "gain": -3.9000000953674316, + "mode": "APO (DR)", + "mute": false, + "q": 3.2799999713897705, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band9": { + "frequency": 10000.0, + "gain": -4.599999904632568, + "mode": "APO (DR)", + "mute": false, + "q": 0.6666666865348816, + "slope": "x1", + "solo": false, + "type": "Hi-shelf", + "width": 4.0 + } + }, + "mode": "IIR", + "num-bands": 10, + "output-gain": 3.9, + "pitch-left": 0.0, + "pitch-right": 0.0, + "right": { + "band0": { + "frequency": 105.0, + "gain": 3.0, + "mode": "APO (DR)", + "mute": false, + "q": 0.6666666865348816, + "slope": "x1", + "solo": false, + "type": "Lo-shelf", + "width": 4.0 + }, + "band1": { + "frequency": 53.5, + "gain": -6.800000190734863, + "mode": "APO (DR)", + "mute": false, + "q": 0.699999988079071, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band2": { + "frequency": 141.89999389648438, + "gain": -2.4000000953674316, + "mode": "APO (DR)", + "mute": false, + "q": 2.7699999809265137, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band3": { + "frequency": 199.89999389648438, + "gain": 6.0, + "mode": "APO (DR)", + "mute": false, + "q": 2.5, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band4": { + "frequency": 943.5, + "gain": -1.399999976158142, + "mode": "APO (DR)", + "mute": false, + "q": 3.5, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band5": { + "frequency": 2352.89990234375, + "gain": -1.5, + "mode": "APO (DR)", + "mute": false, + "q": 3.440000057220459, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band6": { + "frequency": 3523.5, + "gain": 4.800000190734863, + "mode": "APO (DR)", + "mute": false, + "q": 3.859999895095825, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band7": { + "frequency": 5082.7001953125, + "gain": -3.5, + "mode": "APO (DR)", + "mute": false, + "q": 4.53000020980835, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band8": { + "frequency": 6828.10009765625, + "gain": -3.9000000953674316, + "mode": "APO (DR)", + "mute": false, + "q": 3.2799999713897705, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band9": { + "frequency": 10000.0, + "gain": -4.599999904632568, + "mode": "APO (DR)", + "mute": false, + "q": 0.6666666865348816, + "slope": "x1", + "solo": false, + "type": "Hi-shelf", + "width": 4.0 + } + }, + "split-channels": false + }, + "plugins_order": [ + "equalizer#0" + ] + } +} diff --git a/hm/modules/linux/var/easyeffects/output/Default.json b/hm/modules/linux/var/easyeffects/output/Default.json new file mode 100644 index 0000000..02e450d --- /dev/null +++ b/hm/modules/linux/var/easyeffects/output/Default.json @@ -0,0 +1,243 @@ +{ + "output": { + "blocklist": [], + "equalizer#0": { + "balance": 0.0, + "bypass": true, + "input-gain": -8.61, + "left": { + "band0": { + "frequency": 105.0, + "gain": -0.6000000238418579, + "mode": "APO (DR)", + "mute": false, + "q": 0.699999988079071, + "slope": "x1", + "solo": false, + "type": "Lo-shelf", + "width": 4.0 + }, + "band1": { + "frequency": 50.0, + "gain": 3.9000000953674316, + "mode": "APO (DR)", + "mute": false, + "q": 2.0399999618530273, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band2": { + "frequency": 135.6999969482422, + "gain": -1.5, + "mode": "APO (DR)", + "mute": false, + "q": 1.149999976158142, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band3": { + "frequency": 361.3999938964844, + "gain": 3.0999999046325684, + "mode": "APO (DR)", + "mute": false, + "q": 1.159999966621399, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band4": { + "frequency": 1135.300048828125, + "gain": -4.599999904632568, + "mode": "APO (DR)", + "mute": false, + "q": 1.2200000286102295, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band5": { + "frequency": 2703.699951171875, + "gain": -3.799999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 2.799999952316284, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band6": { + "frequency": 3766.800048828125, + "gain": 9.399999618530273, + "mode": "APO (DR)", + "mute": false, + "q": 1.8300000429153442, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band7": { + "frequency": 5260.39990234375, + "gain": 5.0, + "mode": "APO (DR)", + "mute": false, + "q": 3.609999895095825, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band8": { + "frequency": 8775.2998046875, + "gain": -7.400000095367432, + "mode": "APO (DR)", + "mute": false, + "q": 1.75, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band9": { + "frequency": 10000.0, + "gain": -2.299999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 0.699999988079071, + "slope": "x1", + "solo": false, + "type": "Hi-shelf", + "width": 4.0 + } + }, + "mode": "IIR", + "num-bands": 10, + "output-gain": 3.9, + "pitch-left": 0.0, + "pitch-right": 0.0, + "right": { + "band0": { + "frequency": 105.0, + "gain": -0.6000000238418579, + "mode": "APO (DR)", + "mute": false, + "q": 0.699999988079071, + "slope": "x1", + "solo": false, + "type": "Lo-shelf", + "width": 4.0 + }, + "band1": { + "frequency": 50.0, + "gain": 3.9000000953674316, + "mode": "APO (DR)", + "mute": false, + "q": 2.0399999618530273, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band2": { + "frequency": 135.6999969482422, + "gain": -1.5, + "mode": "APO (DR)", + "mute": false, + "q": 1.149999976158142, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band3": { + "frequency": 361.3999938964844, + "gain": 3.0999999046325684, + "mode": "APO (DR)", + "mute": false, + "q": 1.159999966621399, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band4": { + "frequency": 1135.300048828125, + "gain": -4.599999904632568, + "mode": "APO (DR)", + "mute": false, + "q": 1.2200000286102295, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band5": { + "frequency": 2703.699951171875, + "gain": -3.799999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 2.799999952316284, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band6": { + "frequency": 3766.800048828125, + "gain": 9.399999618530273, + "mode": "APO (DR)", + "mute": false, + "q": 1.8300000429153442, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band7": { + "frequency": 5260.39990234375, + "gain": 5.0, + "mode": "APO (DR)", + "mute": false, + "q": 3.609999895095825, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band8": { + "frequency": 8775.2998046875, + "gain": -7.400000095367432, + "mode": "APO (DR)", + "mute": false, + "q": 1.75, + "slope": "x1", + "solo": false, + "type": "Bell", + "width": 4.0 + }, + "band9": { + "frequency": 10000.0, + "gain": -2.299999952316284, + "mode": "APO (DR)", + "mute": false, + "q": 0.699999988079071, + "slope": "x1", + "solo": false, + "type": "Hi-shelf", + "width": 4.0 + } + }, + "split-channels": false + }, + "plugins_order": [ + "equalizer#0" + ] + } +} diff --git a/hm/modules/linux/var/settings.json b/hm/modules/linux/var/settings.json new file mode 100644 index 0000000..e8db804 --- /dev/null +++ b/hm/modules/linux/var/settings.json @@ -0,0 +1,611 @@ +{ + "autoUpdate": true, + "autoUpdateNotification": true, + "useQuickCss": true, + "themeLinks": [], + "enabledThemes": ["stylix.theme.css"], + "enableReactDevtools": false, + "frameless": false, + "transparent": false, + "winCtrlQ": false, + "disableMinSize": false, + "winNativeTitleBar": false, + "plugins": { + "ChatInputButtonAPI": { + "enabled": false + }, + "CommandsAPI": { + "enabled": true + }, + "MemberListDecoratorsAPI": { + "enabled": true + }, + "MessageAccessoriesAPI": { + "enabled": true + }, + "MessageDecorationsAPI": { + "enabled": true + }, + "MessageEventsAPI": { + "enabled": true + }, + "MessagePopoverAPI": { + "enabled": false + }, + "MessageUpdaterAPI": { + "enabled": false + }, + "ServerListAPI": { + "enabled": true + }, + "UserSettingsAPI": { + "enabled": true + }, + "AlwaysAnimate": { + "enabled": false + }, + "AlwaysTrust": { + "enabled": true, + "domain": true, + "file": true + }, + "AnonymiseFileNames": { + "enabled": true, + "anonymiseByDefault": true, + "method": 0, + "randomisedLength": 7 + }, + "AppleMusicRichPresence": { + "enabled": false + }, + "WebRichPresence (arRPC)": { + "enabled": false + }, + "AutomodContext": { + "enabled": false + }, + "BANger": { + "enabled": false + }, + "BetterFolders": { + "enabled": true, + "sidebar": true, + "showFolderIcon": 1, + "keepIcons": false, + "closeAllHomeButton": false, + "closeAllFolders": false, + "forceOpen": false, + "sidebarAnim": true + }, + "BetterGifAltText": { + "enabled": false + }, + "BetterGifPicker": { + "enabled": false + }, + "BetterNotesBox": { + "enabled": false + }, + "BetterRoleContext": { + "enabled": false + }, + "BetterRoleDot": { + "enabled": true, + "bothStyles": false, + "copyRoleColorInProfilePopout": false + }, + "BetterSessions": { + "enabled": true, + "backgroundCheck": false + }, + "BetterSettings": { + "enabled": false, + "disableFade": true, + "eagerLoad": true + }, + "BetterUploadButton": { + "enabled": false + }, + "BiggerStreamPreview": { + "enabled": false + }, + "BlurNSFW": { + "enabled": false + }, + "CallTimer": { + "enabled": true + }, + "ClearURLs": { + "enabled": true + }, + "ClientTheme": { + "enabled": false + }, + "ColorSighted": { + "enabled": false + }, + "ConsoleJanitor": { + "enabled": false + }, + "ConsoleShortcuts": { + "enabled": false + }, + "CopyEmojiMarkdown": { + "enabled": false + }, + "CopyUserURLs": { + "enabled": true + }, + "CrashHandler": { + "enabled": true + }, + "CtrlEnterSend": { + "enabled": false + }, + "CustomRPC": { + "enabled": false + }, + "CustomIdle": { + "enabled": false + }, + "Dearrow": { + "enabled": false + }, + "Decor": { + "enabled": false + }, + "DisableCallIdle": { + "enabled": false + }, + "DontRoundMyTimestamps": { + "enabled": false + }, + "EmoteCloner": { + "enabled": false + }, + "Experiments": { + "enabled": false + }, + "F8Break": { + "enabled": false + }, + "FakeNitro": { + "enabled": false + }, + "FakeProfileThemes": { + "enabled": false + }, + "FavoriteEmojiFirst": { + "enabled": false + }, + "FavoriteGifSearch": { + "enabled": false + }, + "FixCodeblockGap": { + "enabled": false + }, + "FixSpotifyEmbeds": { + "enabled": false + }, + "FixYoutubeEmbeds": { + "enabled": false + }, + "ForceOwnerCrown": { + "enabled": false + }, + "FriendInvites": { + "enabled": false + }, + "FriendsSince": { + "enabled": false + }, + "GameActivityToggle": { + "enabled": false + }, + "GifPaste": { + "enabled": false + }, + "GreetStickerPicker": { + "enabled": false + }, + "HideAttachments": { + "enabled": false + }, + "iLoveSpam": { + "enabled": false + }, + "IgnoreActivities": { + "enabled": false + }, + "ImageLink": { + "enabled": false + }, + "ImageZoom": { + "enabled": false + }, + "ImplicitRelationships": { + "enabled": false + }, + "InvisibleChat": { + "enabled": false + }, + "KeepCurrentChannel": { + "enabled": false + }, + "LastFMRichPresence": { + "enabled": false + }, + "LoadingQuotes": { + "enabled": false + }, + "MaskedLinkPaste": { + "enabled": false + }, + "MemberCount": { + "enabled": false + }, + "MessageClickActions": { + "enabled": false + }, + "MessageLatency": { + "enabled": false + }, + "MessageLinkEmbeds": { + "enabled": false + }, + "MessageLogger": { + "enabled": false + }, + "MessageTags": { + "enabled": false + }, + "MoreCommands": { + "enabled": false + }, + "MoreKaomoji": { + "enabled": false + }, + "MoreUserTags": { + "enabled": false + }, + "Moyai": { + "enabled": false + }, + "MutualGroupDMs": { + "enabled": false + }, + "NewGuildSettings": { + "enabled": false + }, + "NoBlockedMessages": { + "enabled": false + }, + "NoDefaultHangStatus": { + "enabled": false + }, + "NoDevtoolsWarning": { + "enabled": false + }, + "NoF1": { + "enabled": false + }, + "NoMosaic": { + "enabled": false + }, + "NoOnboardingDelay": { + "enabled": false + }, + "NoPendingCount": { + "enabled": false + }, + "NoProfileThemes": { + "enabled": false + }, + "NoReplyMention": { + "enabled": false + }, + "NoScreensharePreview": { + "enabled": false + }, + "NoServerEmojis": { + "enabled": false + }, + "NoTypingAnimation": { + "enabled": false + }, + "NoUnblockToJump": { + "enabled": false + }, + "NormalizeMessageLinks": { + "enabled": false + }, + "NotificationVolume": { + "enabled": false + }, + "NSFWGateBypass": { + "enabled": false + }, + "OnePingPerDM": { + "enabled": false + }, + "oneko": { + "enabled": false + }, + "OpenInApp": { + "enabled": false + }, + "OverrideForumDefaults": { + "enabled": false + }, + "PartyMode": { + "enabled": false + }, + "PauseInvitesForever": { + "enabled": false + }, + "PermissionFreeWill": { + "enabled": false + }, + "PermissionsViewer": { + "enabled": false + }, + "petpet": { + "enabled": false + }, + "PictureInPicture": { + "enabled": false + }, + "PinDMs": { + "enabled": false + }, + "PlainFolderIcon": { + "enabled": false + }, + "PlatformIndicators": { + "enabled": true + }, + "PreviewMessage": { + "enabled": false + }, + "QuickMention": { + "enabled": false + }, + "QuickReply": { + "enabled": false + }, + "ReactErrorDecoder": { + "enabled": false + }, + "ReadAllNotificationsButton": { + "enabled": true + }, + "RelationshipNotifier": { + "enabled": false + }, + "ReplaceGoogleSearch": { + "enabled": false + }, + "ReplyTimestamp": { + "enabled": false + }, + "RevealAllSpoilers": { + "enabled": false + }, + "ReverseImageSearch": { + "enabled": false + }, + "ReviewDB": { + "enabled": false + }, + "RoleColorEverywhere": { + "enabled": false + }, + "SecretRingToneEnabler": { + "enabled": false + }, + "Summaries": { + "enabled": false + }, + "SendTimestamps": { + "enabled": false + }, + "ServerInfo": { + "enabled": false + }, + "ServerListIndicators": { + "enabled": false + }, + "ShikiCodeblocks": { + "enabled": false + }, + "ShowAllMessageButtons": { + "enabled": false + }, + "ShowConnections": { + "enabled": false + }, + "ShowHiddenChannels": { + "enabled": true, + "showMode": 0, + "hideUnreads": true + }, + "ShowHiddenThings": { + "enabled": true, + "showTimeouts": true, + "showInvitesPaused": true, + "showModView": true, + "disableDiscoveryFilters": true, + "disableDisallowedDiscoveryFilters": true + }, + "ShowMeYourName": { + "enabled": false + }, + "ShowTimeoutDuration": { + "enabled": false + }, + "SilentMessageToggle": { + "enabled": false + }, + "SilentTyping": { + "enabled": false + }, + "SortFriendRequests": { + "enabled": false + }, + "SpotifyControls": { + "enabled": true, + "hoverControls": false + }, + "SpotifyCrack": { + "enabled": false + }, + "SpotifyShareCommands": { + "enabled": false + }, + "StartupTimings": { + "enabled": false + }, + "StreamerModeOnStream": { + "enabled": false + }, + "SuperReactionTweaks": { + "enabled": false + }, + "TextReplace": { + "enabled": false + }, + "ThemeAttributes": { + "enabled": false + }, + "TimeBarAllActivities": { + "enabled": false + }, + "Translate": { + "enabled": false + }, + "TypingIndicator": { + "enabled": false + }, + "TypingTweaks": { + "enabled": false + }, + "Unindent": { + "enabled": false + }, + "UnlockedAvatarZoom": { + "enabled": false + }, + "UnsuppressEmbeds": { + "enabled": false + }, + "UserVoiceShow": { + "enabled": false + }, + "USRBG": { + "enabled": false + }, + "ValidReply": { + "enabled": false + }, + "ValidUser": { + "enabled": false + }, + "VoiceChatDoubleClick": { + "enabled": false + }, + "VcNarrator": { + "enabled": false + }, + "VencordToolbox": { + "enabled": false + }, + "ViewIcons": { + "enabled": false + }, + "ViewRaw": { + "enabled": false + }, + "VoiceDownload": { + "enabled": false + }, + "VoiceMessages": { + "enabled": false + }, + "WebKeybinds": { + "enabled": true + }, + "WebScreenShareFixes": { + "enabled": true + }, + "WhoReacted": { + "enabled": false + }, + "XSOverlay": { + "enabled": false + }, + "NoTrack": { + "enabled": true, + "disableAnalytics": true + }, + "WebContextMenus": { + "enabled": true, + "addBack": true + }, + "Settings": { + "enabled": true, + "settingsLocation": "aboveNitro" + }, + "SupportHelper": { + "enabled": true + }, + "YoutubeAdblock": { + "enabled": true + }, + "AlwaysExpandRoles": { + "enabled": false + }, + "FullSearchContext": { + "enabled": false + }, + "UserMessagesPronouns": { + "enabled": false + }, + "DynamicImageModalAPI": { + "enabled": false + }, + "AccountPanelServerProfile": { + "enabled": false + }, + "CopyFileContents": { + "enabled": false + }, + "FixImagesQuality": { + "enabled": false + }, + "MentionAvatars": { + "enabled": false + }, + "NoMaskedUrlPaste": { + "enabled": false + }, + "StickerPaste": { + "enabled": false + }, + "VolumeBooster": { + "enabled": false + } + }, + "notifications": { + "timeout": 5000, + "position": "bottom-right", + "useNative": "not-focused", + "logLimit": 50 + }, + "cloud": { + "authenticated": false, + "url": "https://api.vencord.dev/", + "settingsSync": false, + "settingsSyncVersion": 1731210778467 + } +} + diff --git a/hosts/demeter/default.nix b/hosts/demeter/default.nix deleted file mode 100644 index 93b71aa..0000000 --- a/hosts/demeter/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - inputs, - ... -}: -{ - imports = - [ - ./configuration.nix - ../../modules/linux - ../../overlays - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.backupFileExtension = "backup"; - home-manager.extraSpecialArgs = { - inherit inputs; - }; - home-manager.users.youwen = { - imports = - [ - ../../users/youwen/linux/laptop - ../../users/youwen/linux/packages/x86_64 - ../../users/youwen/linux/programs - (import ../../users/youwen/common/fastfetch { }) - ../../users/youwen/common - ../../users/youwen/linux/spicetify - ./home-manager-extras - ] - ++ (with inputs; [ - nix-index-database.hmModules.nix-index - ]); - }; - } - ] - ++ (with inputs; [ - lanzaboote.nixosModules.lanzaboote - home-manager.nixosModules.home-manager - ]); -} diff --git a/modules/linux/audio/default.nix b/modules/linux/audio/default.nix index a1e1ab6..c91d9aa 100755 --- a/modules/linux/audio/default.nix +++ b/modules/linux/audio/default.nix @@ -20,6 +20,7 @@ in alsa.support32Bit = true; pulse.enable = true; jack.enable = true; + wireplumber.enable = true; }; }; } diff --git a/modules/linux/desktop-environment/default.nix b/modules/linux/desktop-environment/default.nix index 734506a..b6efc97 100644 --- a/modules/linux/desktop-environment/default.nix +++ b/modules/linux/desktop-environment/default.nix @@ -9,7 +9,13 @@ let in { options.liminalOS.desktop = { - enable = lib.mkEnableOption "liminalOS desktop environment with Hyprland and other utilities"; + enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.enable; + description = '' + Whether to enable the liminalOS desktop environment. + ''; + }; hyprland.enable = lib.mkOption { type = lib.types.bool; default = cfg.enable; diff --git a/modules/linux/flatpak/default.nix b/modules/linux/flatpak/default.nix index 417d9f4..6c65c41 100644 --- a/modules/linux/flatpak/default.nix +++ b/modules/linux/flatpak/default.nix @@ -27,6 +27,7 @@ in }; config = lib.mkIf cfg.enable { + xdg.portal.enable = true; services.flatpak = { enable = true; diff --git a/modules/linux/misc/default.nix b/modules/linux/misc/default.nix index 7e93c75..b23d6ce 100644 --- a/modules/linux/misc/default.nix +++ b/modules/linux/misc/default.nix @@ -55,9 +55,21 @@ in default = pkgs.neovim; description = "Default text editor that will be installed and set as $EDITOR. Set to null to disable setting and installing default text editor."; }; + formFactor = lib.mkOption { + type = lib.types.nullOr ( + lib.types.enum [ + "laptop" + "desktop" + ] + ); + default = null; + description = '' + Form factor of the machine. Adjusts some UI settings. + ''; + }; }; - config = { + config = lib.mkIf cfg.enable { services.printing.enable = mkIf cfg.system.printing.enable true; services.avahi = mkIf cfg.system.printing.enable { @@ -113,5 +125,14 @@ in LC_TIME = "en_US.UTF-8"; }; }; + + assertions = [ + { + assertion = cfg.formFactor != null; + message = '' + You must set `liminalOS.formFactor` to either "laptop" or "desktop"! + ''; + } + ]; }; } diff --git a/modules/linux/networking/default.nix b/modules/linux/networking/default.nix index 58c7473..7f898e5 100755 --- a/modules/linux/networking/default.nix +++ b/modules/linux/networking/default.nix @@ -19,7 +19,13 @@ let in { options.liminalOS.system.networking = { - enable = lib.mkEnableOption "networking"; + enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.enable; + description = '' + Whether to enable networking features. + ''; + }; firewallPresets = { grimDawn = lib.mkEnableOption "firewall ports for Grim Dawn"; vite = lib.mkEnableOption "firewall ports for Vite"; diff --git a/modules/linux/stylix/default.nix b/modules/linux/stylix/default.nix index cc46bfb..52bf4db 100644 --- a/modules/linux/stylix/default.nix +++ b/modules/linux/stylix/default.nix @@ -10,7 +10,13 @@ let in { options.liminalOS.theming = { - enable = lib.mkEnableOption "theming"; + enable = lib.mkOption { + type = lib.types.bool; + default = config.liminalOS.enable; + description = '' + Whether to uniformly theme the entire system using Stylix. + ''; + }; plymouth.enable = lib.mkOption { type = lib.types.bool; default = cfg.enable; diff --git a/hosts/adrastea/configuration.nix b/reference/hosts/adrastea/configuration.nix similarity index 100% rename from hosts/adrastea/configuration.nix rename to reference/hosts/adrastea/configuration.nix diff --git a/hosts/adrastea/default.nix b/reference/hosts/adrastea/default.nix similarity index 100% rename from hosts/adrastea/default.nix rename to reference/hosts/adrastea/default.nix diff --git a/hosts/adrastea/hardware-configuration.nix b/reference/hosts/adrastea/hardware-configuration.nix similarity index 100% rename from hosts/adrastea/hardware-configuration.nix rename to reference/hosts/adrastea/hardware-configuration.nix diff --git a/hosts/adrastea/home-manager-extras/default.nix b/reference/hosts/adrastea/home-manager-extras/default.nix similarity index 100% rename from hosts/adrastea/home-manager-extras/default.nix rename to reference/hosts/adrastea/home-manager-extras/default.nix diff --git a/hosts/callisto/configuration.nix b/reference/hosts/callisto/configuration.nix similarity index 100% rename from hosts/callisto/configuration.nix rename to reference/hosts/callisto/configuration.nix diff --git a/hosts/callisto/default.nix b/reference/hosts/callisto/default.nix similarity index 100% rename from hosts/callisto/default.nix rename to reference/hosts/callisto/default.nix diff --git a/hosts/callisto/hardware-configuration.nix b/reference/hosts/callisto/hardware-configuration.nix similarity index 100% rename from hosts/callisto/hardware-configuration.nix rename to reference/hosts/callisto/hardware-configuration.nix diff --git a/hosts/callisto/home-manager-extras/default.nix b/reference/hosts/callisto/home-manager-extras/default.nix similarity index 100% rename from hosts/callisto/home-manager-extras/default.nix rename to reference/hosts/callisto/home-manager-extras/default.nix diff --git a/hosts/callisto/home-manager-extras/neofetch-asahi.conf b/reference/hosts/callisto/home-manager-extras/neofetch-asahi.conf similarity index 100% rename from hosts/callisto/home-manager-extras/neofetch-asahi.conf rename to reference/hosts/callisto/home-manager-extras/neofetch-asahi.conf diff --git a/hosts/cassini/configuration.nix b/reference/hosts/cassini/configuration.nix similarity index 100% rename from hosts/cassini/configuration.nix rename to reference/hosts/cassini/configuration.nix diff --git a/hosts/cassini/default.nix b/reference/hosts/cassini/default.nix similarity index 100% rename from hosts/cassini/default.nix rename to reference/hosts/cassini/default.nix diff --git a/hosts/cassini/hardware-configuration.nix b/reference/hosts/cassini/hardware-configuration.nix similarity index 100% rename from hosts/cassini/hardware-configuration.nix rename to reference/hosts/cassini/hardware-configuration.nix diff --git a/hosts/cassini/home-manager-extras/default.nix b/reference/hosts/cassini/home-manager-extras/default.nix similarity index 100% rename from hosts/cassini/home-manager-extras/default.nix rename to reference/hosts/cassini/home-manager-extras/default.nix diff --git a/hosts/demeter/configuration.nix b/reference/hosts/demeter/configuration.nix similarity index 91% rename from hosts/demeter/configuration.nix rename to reference/hosts/demeter/configuration.nix index 7183610..aa63bad 100755 --- a/hosts/demeter/configuration.nix +++ b/reference/hosts/demeter/configuration.nix @@ -2,10 +2,8 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). { - config, inputs, pkgs, - lib, ... }: { @@ -20,20 +18,15 @@ flakeLocation = "/home/youwen/.config/liminalOS"; config.allowUnfree = true; defaultEditor = inputs.viminal.packages.${pkgs.system}.default; + formFactor = "desktop"; system = { audio.prod.enable = true; networking = { - enable = true; firewallPresets.vite = true; cloudflareNameservers.enable = true; }; - graphics = { - enable = true; - nvidia.enable = true; - }; + graphics.nvidia.enable = true; }; - theming.enable = true; - desktop.enable = true; extras.gaming = { enable = true; roblox.enable = true; @@ -42,7 +35,6 @@ gamemodeUsers = [ "youwen" ]; }; }; - programs.flatpak.enable = true; }; time.timeZone = "America/Los_Angeles"; diff --git a/reference/hosts/demeter/default.nix b/reference/hosts/demeter/default.nix new file mode 100644 index 0000000..279603c --- /dev/null +++ b/reference/hosts/demeter/default.nix @@ -0,0 +1,21 @@ +{ + inputs, + ... +}: +{ + imports = + [ + ./configuration.nix + ../../../modules/linux + ../../../hm + ../../../overlays + { + home-manager.users.youwen = { + imports = [ ./home.nix ]; + }; + } + ] + ++ (with inputs; [ + lanzaboote.nixosModules.lanzaboote + ]); +} diff --git a/hosts/demeter/hardware-configuration.nix b/reference/hosts/demeter/hardware-configuration.nix similarity index 100% rename from hosts/demeter/hardware-configuration.nix rename to reference/hosts/demeter/hardware-configuration.nix diff --git a/hosts/demeter/home-manager-extras/default.nix b/reference/hosts/demeter/home.nix similarity index 64% rename from hosts/demeter/home-manager-extras/default.nix rename to reference/hosts/demeter/home.nix index 92e69ee..cc62b90 100644 --- a/hosts/demeter/home-manager-extras/default.nix +++ b/reference/hosts/demeter/home.nix @@ -1,10 +1,13 @@ +{ lib, ... }: { - lib, - ... -}: -{ + imports = [ + ../../../hm/modules + ../../users/youwen + ]; + + home.stateVersion = "24.05"; + wayland.windowManager.hyprland.settings.monitor = [ - # "DP-1,2560x1440@165,1920x0,auto" "DP-1,2560x1440@144,1920x0,auto" "HDMI-A-1,1920x1080@60,0x0,1" ]; diff --git a/hosts/phobos/configuration.nix b/reference/hosts/phobos/configuration.nix similarity index 100% rename from hosts/phobos/configuration.nix rename to reference/hosts/phobos/configuration.nix diff --git a/hosts/phobos/default.nix b/reference/hosts/phobos/default.nix similarity index 100% rename from hosts/phobos/default.nix rename to reference/hosts/phobos/default.nix diff --git a/reference/users/youwen/default.nix b/reference/users/youwen/default.nix new file mode 100644 index 0000000..a133346 --- /dev/null +++ b/reference/users/youwen/default.nix @@ -0,0 +1,23 @@ +{ + imports = [ + ../../../hm/modules + ]; + + home = { + username = "youwen"; + homeDirectory = "/home/youwen"; + }; + + liminalOS = { + utils.easyeffects.enable = true; + }; + + programs.git = { + userName = "Youwen Wu"; + userEmail = "youwenw@gmail.com"; + signing = { + signByDefault = true; + key = "8F5E6C1AF90976CA7102917A865658ED1FE61EC3"; + }; + }; +} From 0b8e5ade7b13fbdbbfe4c5638a34e933607d8061 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 19:54:42 -0800 Subject: [PATCH 25/43] feat: overhaul callisto to use new liminalOS configuration method --- hm/modules/linux/platform-tweaks/default.nix | 2 + reference/hosts/callisto/configuration.nix | 134 +-- reference/hosts/callisto/default.nix | 30 +- .../callisto/home-manager-extras/default.nix | 4 - .../home-manager-extras/neofetch-asahi.conf | 864 ------------------ reference/hosts/callisto/home.nix | 8 + 6 files changed, 22 insertions(+), 1020 deletions(-) delete mode 100644 reference/hosts/callisto/home-manager-extras/default.nix delete mode 100644 reference/hosts/callisto/home-manager-extras/neofetch-asahi.conf create mode 100644 reference/hosts/callisto/home.nix diff --git a/hm/modules/linux/platform-tweaks/default.nix b/hm/modules/linux/platform-tweaks/default.nix index f3ab7e4..4a389e4 100644 --- a/hm/modules/linux/platform-tweaks/default.nix +++ b/hm/modules/linux/platform-tweaks/default.nix @@ -25,6 +25,8 @@ in }; config = { + services.tlp.enable = lib.mkIf (cfg.formFactor == "laptop") true; + programs.light.enable = lib.mkIf (cfg.formFactor == "laptop") true; assertions = [ { assertion = cfg.formFactor != null; diff --git a/reference/hosts/callisto/configuration.nix b/reference/hosts/callisto/configuration.nix index f94980b..3a8828a 100755 --- a/reference/hosts/callisto/configuration.nix +++ b/reference/hosts/callisto/configuration.nix @@ -4,54 +4,32 @@ { inputs, pkgs, - config, ... }: { - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - # ./apple-silicon-support - ]; + imports = [ ./hardware-configuration.nix ]; + + networking.hostName = "callisto"; + time.timeZone = "America/Los_Angeles"; liminalOS = { + flakeLocation = "/home/youwen/.config/liminalOS"; + formFactor = "laptop"; system = { - audio.enable = true; networking = { - enable = true; firewallPresets.vite = true; cloudflareNameservers.enable = true; }; - fonts.enable = true; }; - theming = { - enable = true; - }; - desktop.enable = true; }; boot = { loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = false; - plymouth = { - enable = true; - font = "${config.stylix.fonts.monospace.package}/share/fonts/truetype/NerdFonts/CaskaydiaCove/CaskaydiaCoveNerdFontMono-Regular.ttf"; - }; - consoleLogLevel = 3; - initrd.verbose = false; - kernelParams = [ - "quiet" - "splash" - "boot.shell_on_fail" - "rd.systemd.show_status=false" - "rd.udev.log_level=3" - "udev.log_priority=3" - "apple_dcp.show_notch=1" - ]; + kernelParams = [ "apple_dcp.show_notch=1" ]; extraModprobeConfig = '' options hid_apple iso_layout=0 ''; - initrd.systemd.enable = true; }; hardware.asahi = { @@ -60,79 +38,20 @@ experimentalGPUInstallMode = "overlay"; }; - networking.hostName = "callisto"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - networking.wireless.iwd = { - enable = true; - settings.General.EnableNetworkConfiguration = true; - }; - nixpkgs.overlays = [ inputs.apple-silicon.overlays.apple-silicon-overlay inputs.vesktop-bin.overlays.default ]; - programs.light.enable = true; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - # networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "America/Los_Angeles"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - - # Enable the X11 windowing system. - # You can disable this if you're only using the Wayland session. - services.xserver.enable = false; - - programs.nix-ld = { - enable = true; - libraries = with pkgs; [ - icu - xorg.libXtst - xorg.libXi - ]; - }; - - # Configure keymap in X11 - services.xserver = { - xkb.layout = "us"; - xkb.variant = ""; - }; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.youwen = { isNormalUser = true; description = "Youwen Wu"; - # Wheel is required for iwctl as non-root extraGroups = [ "wheel" ]; + shell = pkgs.fish; }; nix.settings = { trusted-users = [ - "root" "youwen" ]; }; @@ -141,12 +60,6 @@ KERNEL=="macsmc-battery", SUBSYSTEM=="power_supply", ATTR{charge_control_end_threshold}="90", ATTR{charge_control_start_threshold}="85" ''; - # # Allow unfree packages - # nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - services.keyd = { enable = true; keyboards = { @@ -172,34 +85,5 @@ }; }; - services.tlp.enable = true; - - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - - services.blueman.enable = true; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - programs.dconf.enable = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "24.11"; # Did you read the comment? - - programs.zsh.enable = false; - programs.fish.enable = true; - users.users.youwen.shell = pkgs.fish; + system.stateVersion = "24.11"; } diff --git a/reference/hosts/callisto/default.nix b/reference/hosts/callisto/default.nix index b6d3f08..163d0c3 100644 --- a/reference/hosts/callisto/default.nix +++ b/reference/hosts/callisto/default.nix @@ -7,39 +7,15 @@ imports = [ ./configuration.nix - ../../modules/linux/audio - ../../modules/linux/networking - ../../modules/linux/fonts - ../../modules/linux/greeter - ../../modules/linux/core - ../../modules/linux/desktop-environment - ../../modules/linux/stylix - ../../overlays + ../../../modules/linux + ../../../overlays { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.backupFileExtension = "backup"; - home-manager.extraSpecialArgs = { - inherit inputs; - inherit system; - }; home-manager.users.youwen = { - imports = - [ - ../../users/youwen/common - ../../users/youwen/linux/laptop - ../../users/youwen/linux/packages/aarch-64 - (import ../../users/youwen/common/fastfetch { }) - ./home-manager-extras - ] - ++ (with inputs; [ - nix-index-database.hmModules.nix-index - ]); + imports = [ ./home.nix ]; }; } ] ++ (with inputs; [ - home-manager.nixosModules.home-manager apple-silicon.nixosModules.apple-silicon-support ]); } diff --git a/reference/hosts/callisto/home-manager-extras/default.nix b/reference/hosts/callisto/home-manager-extras/default.nix deleted file mode 100644 index aee3a2d..0000000 --- a/reference/hosts/callisto/home-manager-extras/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs, ... }: -{ - # home.file.".config/neofetch/config.conf".source = ./neofetch-asahi.conf; -} diff --git a/reference/hosts/callisto/home-manager-extras/neofetch-asahi.conf b/reference/hosts/callisto/home-manager-extras/neofetch-asahi.conf deleted file mode 100644 index b9e9bfe..0000000 --- a/reference/hosts/callisto/home-manager-extras/neofetch-asahi.conf +++ /dev/null @@ -1,864 +0,0 @@ -# Source: https://github.com/Chick2D/neofetch-themes/ - -# Made by https://github.com/HimDek/ (HimDek) -# A matching oh-my-zsh theme: https://github.com/HimDek/Acenoster-ZSH-Theme/ - -# Customization Wiki https://github.com/dylanaraps/neofetch/wiki/Customizing-Info - -print_info() { - prin " " - info "​ ​​ ​​​ " title - prin " " - info "${cl2} ╭─" distro - info "${cl2} ├─" kernel - # info "${cl2} ├─" users - info "${cl2} ├─󰏗" packages - info "${cl2} ╰─" shell - echo - info "${cl6} ╭─" de - info "${cl6} ├─" term - info "${cl6} ╰─" term_font - echo - info "${cl4} ╭─" model - info "${cl4} ├─󰍛" cpu - # info "${cl4} ├─󰍹" gpu - prin "${cl4} ├─󰍹 ${cl0} Apple Neural Engine" - info "${cl4} ├─" gpu_driver - info "${cl4} ├─" resolution - info "${cl4} ├─" memory - # info "${cl4} ├─ ${cl0}" disk -# info "${cl4} ├─󰁹 ${cl0} " battery - # info "${cl4} ╰─󰄉" uptime - info "${cl4} ╰─ ${cl0}" disk - - # prin " " - # prin " \n \n \n \n \n \n ${cl3} \n \n ${cl5} \n \n ${cl2} \n \n ${cl6} \n \n ${cl4} \n \n ${cl1} \n \n ${cl7} \n \n ${cl0} \n " - -} - -##--------- Title - -# Hide/Show Fully qualified domain name. -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --title_fqdn -title_fqdn="on" - - -##--------- Kernel - -# Shorten the output of the kernel function. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --kernel_shorthand -# Supports: Everything except *BSDs (except PacBSD and PC-BSD) -# -# Example: -# on: '4.8.9-1-ARCH' -# off: 'Linux 4.8.9-1-ARCH' -kernel_shorthand="off" - - -##--------- Distro - -# Shorten the output of the distro function -# -# Default: 'off' -# Values: 'on', 'tiny', 'off' -# Flag: --distro_shorthand -# Supports: Everything except Windows and Haiku -distro_shorthand="on" - -# Show/Hide OS Architecture. -# Show 'x86_64', 'x86' and etc in 'Distro:' output. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --os_arch -# -# Example: -# on: 'Arch Linux x86_64' -# off: 'Arch Linux' -os_arch="on" - - -##--------- Uptime - -# Shorten the output of the uptime function -# -# Default: 'on' -# Values: 'on', 'tiny', 'off' -# Flag: --uptime_shorthand -# -# Example: -# on: '2 days, 10 hours, 3 mins' -# tiny: '2d 10h 3m' -# off: '2 days, 10 hours, 3 minutes' -uptime_shorthand="on" - - -##--------- Memory - -# Show memory pecentage in output. -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --memory_percent -# -# Example: -# on: '1801MiB / 7881MiB (22%)' -# off: '1801MiB / 7881MiB' -memory_percent="on" - -# Change memory output unit. -# -# Default: 'mib' -# Values: 'kib', 'mib', 'gib' -# Flag: --memory_unit -# -# Example: -# kib '1020928KiB / 7117824KiB' -# mib '1042MiB / 6951MiB' -# gib: ' 0.98GiB / 6.79GiB' -memory_unit="Gib" - - -##--------- Packages - -# Show/Hide Package Manager names. -# -# Default: 'tiny' -# Values: 'on', 'tiny' 'off' -# Flag: --package_managers -# -# Example: -# on: '998 (pacman), 8 (flatpak), 4 (snap)' -# tiny: '908 (pacman, flatpak, snap)' -# off: '908' -package_managers="on" - - -##--------- Shell - -# Show the path to $SHELL -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --shell_path -# -# Example: -# on: '/bin/bash' -# off: 'bash' -shell_path="off" - -# Show $SHELL version -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --shell_version -# -# Example: -# on: 'bash 4.4.5' -# off: 'bash' -shell_version="on" - - -##--------- CPU - -# CPU speed type -# -# Default: 'bios_limit' -# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. -# Flag: --speed_type -# Supports: Linux with 'cpufreq' -# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. -speed_type="scaling_max_freq" - -# CPU speed shorthand -# -# Default: 'off' -# Values: 'on', 'off'. -# Flag: --speed_shorthand -# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz -# -# Example: -# on: 'i7-6500U (4) @ 3.1GHz' -# off: 'i7-6500U (4) @ 3.100GHz' -speed_shorthand="on" - -# Enable/Disable CPU brand in output. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --cpu_brand -# -# Example: -# on: 'Intel i7-6500U' -# off: 'i7-6500U (4)' -cpu_brand="on" - -# CPU Speed -# Hide/Show CPU speed. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --cpu_speed -# -# Example: -# on: 'Intel i7-6500U (4) @ 3.1GHz' -# off: 'Intel i7-6500U (4)' -cpu_speed="on" - -# CPU Cores -# Display CPU cores in output -# -# Default: 'logical' -# Values: 'logical', 'physical', 'off' -# Flag: --cpu_cores -# Support: 'physical' doesn't work on BSD. -# -# Example: -# logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) -# physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) -# off: 'Intel i7-6500U @ 3.1GHz' -cpu_cores="logical" - -# CPU Temperature -# Hide/Show CPU temperature. -# Note the temperature is added to the regular CPU function. -# -# Default: 'off' -# Values: 'C', 'F', 'off' -# Flag: --cpu_temp -# Supports: Linux, BSD -# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable -# coretemp kernel module. This only supports newer Intel processors. -# -# Example: sudo rm /var/lib/pacman/db.lck -# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]' -# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]' -# off: 'Intel i7-6500U (4) @ 3.1GHz' -cpu_temp="on" - - -##--------- GPU - -# Enable/Disable GPU Brand -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --gpu_brand -# -# Example: -# on: 'AMD HD 7950' -# off: 'HD 7950' -gpu_brand="on" - -# Which GPU to display -# -# Default: 'all' -# Values: 'all', 'dedicated', 'integrated' -# Flag: --gpu_type -# Supports: Linux -# -# Example: -# all: -# GPU1: AMD HD 7950 -# GPU2: Intel Integrated Graphics -# -# dedicated: -# GPU1: AMD HD 7950 -# -# integrated: -# GPU1: Intel Integrated Graphics -gpu_type="all" - - -##--------- Resolution - -# Display refresh rate next to each monitor -# Default: 'off' -# Values: 'on', 'off' -# Flag: --refresh_rate -# Supports: Doesn't work on Windows. -# -# Example: -# on: '1920x1080 @ 60Hz' -# off: '1920x1080' -refresh_rate="on" - - -##--------- Gtk Theme / Icons / Font - -# Shorten output of GTK Theme / Icons / Font -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --gtk_shorthand -# -# Example: -# on: 'Numix, Adwaita' -# off: 'Numix [GTK2], Adwaita [GTK3]' -gtk_shorthand="off" - -# Enable/Disable gtk2 Theme / Icons / Font -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --gtk2 -# -# Example: -# on: 'Numix [GTK2], Adwaita [GTK3]' -# off: 'Adwaita [GTK3]' -gtk2="off" - -# Enable/Disable gtk3 Theme / Icons / Font -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --gtk3 -# -# Example: -# on: 'Numix [GTK2], Adwaita [GTK3]' -# off: 'Numix [GTK2]' -gtk3="off" - - -##--------- IP Address - -# Website to ping for the public IP -# -# Default: 'http://ident.me' -# Values: 'url' -# Flag: --ip_host -public_ip_host="http://ident.me" - -# Public IP timeout. -# -# Default: '2' -# Values: 'int' -# Flag: --ip_timeout -public_ip_timeout=2 - -# Desktop Environment - -# Show Desktop Environment version -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --de_version -de_version="on" - - -##--------- Disk - -# Which disks to display. -# The values can be any /dev/sdXX, mount point or directory. -# NOTE: By default we only show the disk info for '/'. -# -# Default: '/' -# Values: '/', '/dev/sdXX', '/path/to/drive'. -# Flag: --disk_show -# -# Example: -# disk_show=('/' '/dev/sdb1'): -# 'Disk (/): 74G / 118G (66%)' -# 'Disk (/mnt/Videos): 823G / 893G (93%)' -# -# disk_show=('/'): -# 'Disk (/): 74G / 118G (66%)' -# -disk_show=('/') - -# Disk subtitle. -# What to append to the Disk subtitle. -# -# Default: 'mount' -# Values: 'mount', 'name', 'dir', 'none' -# Flag: --disk_subtitle -# -# Example: -# name: 'Disk (/dev/sda1): 74G / 118G (66%)' -# 'Disk (/dev/sdb2): 74G / 118G (66%)' -# -# mount: 'Disk (/): 74G / 118G (66%)' -# 'Disk (/mnt/Local Disk): 74G / 118G (66%)' -# 'Disk (/mnt/Videos): 74G / 118G (66%)' -# -# dir: 'Disk (/): 74G / 118G (66%)' -# 'Disk (Local Disk): 74G / 118G (66%)' -# 'Disk (Videos): 74G / 118G (66%)' -# -# none: 'Disk: 74G / 118G (66%)' -# 'Disk: 74G / 118G (66%)' -# 'Disk: 74G / 118G (66%)' -disk_subtitle="mount" - -# Disk percent. -# Show/Hide disk percent. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --disk_percent -# -# Example: -# on: 'Disk (/): 74G / 118G (66%)' -# off: 'Disk (/): 74G / 118G' -disk_percent="on" - - -##--------- Song - -# Manually specify a music player. -# -# Default: 'auto' -# Values: 'auto', 'player-name' -# Flag: --music_player -# -# Available values for 'player-name': -# -# amarok -# audacious -# banshee -# bluemindo -# clementine -# cmus -# deadbeef -# deepin-music -# dragon -# elisa -# exaile -# gnome-music -# gmusicbrowser -# gogglesmm -# guayadeque -# io.elementary.music -# iTunes -# juk -# lollypop -# mocp -# mopidy -# mpd -# muine -# netease-cloud-music -# olivia -# playerctl -# pogo -# pragha -# qmmp -# quodlibet -# rhythmbox -# sayonara -# smplayer -# spotify -# strawberry -# tauonmb -# tomahawk -# vlc -# xmms2d -# xnoise -# yarock -music_player="auto" - -# Format to display song information. -# -# Default: '%artist% - %album% - %title%' -# Values: '%artist%', '%album%', '%title%' -# Flag: --song_format -# -# Example: -# default: 'Song: Jet - Get Born - Sgt Major' -song_format="%artist% - %album% - %title%" - -# Print the Artist, Album and Title on separate lines -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --song_shorthand -# -# Example: -# on: 'Artist: The Fratellis' -# 'Album: Costello Music' -# 'Song: Chelsea Dagger' -# -# off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' -song_shorthand="off" - -# 'mpc' arguments (specify a host, password etc). -# -# Default: '' -# Example: mpc_args=(-h HOST -P PASSWORD) -mpc_args=() - - -##--------- Text Colors - -# Text Colors -# -# Default: 'distro' -# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' -# Flag: --colors -# -# Each number represents a different part of the text in -# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' -# -# Example: -# colors=(distro) - Text is colored based on Distro colors. -# colors=(4 6 1 8 8 6) - Text is colored in the order above. -colors=(distro) - - -##--------- Text Options - -# Toggle bold text -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --bold -bold="on" - -# Enable/Disable Underline -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --underline -underline_enabled="on" - -# Underline character -# -# Default: '-' -# Values: 'string' -# Flag: --underline_char -underline_char="󰍴" - -# Info Separator -# Replace the default separator with the specified string. -# -# Default: ':' -# Flag: --separator -# -# Example: -# separator="->": 'Shell-> bash' -# separator=" =": 'WM = dwm' -separator=" " - -##--------- Color Blocks - -# Color block range -# The range of colors to print. -# -# Default: '0', '15' -# Values: 'num' -# Flag: --block_range -# -# Example: -# -# Display colors 0-7 in the blocks. (8 colors) -# neofetch --block_range 0 7 -# -# Display colors 0-15 in the blocks. (16 colors) -# neofetch --block_range 0 15 -#block_range=(8 15) -block_range=(1 8) - -# Colors for custom colorblocks -#colors -#bold="(tput bold)" -magenta="\033[1;35m" -green="\033[1;32m" -white="\033[1;37m" -blue="\033[1;34m" -red="\033[1;31m" -black="\033[1;40;30m" -yellow="\033[1;33m" -cyan="\033[1;36m" -reset="\033[0m" -bgyellow="\033[1;43;33m" -bgwhite="\033[1;47;37m" -cl0="${reset}" -cl1="${magenta}" -cl2="${green}" -cl3="${white}" -cl4="${blue}" -cl5="${red}" -cl6="${yellow}" -cl7="${cyan}" -cl8="${black}" -cl9="${bgyellow}" -cl10="${bgwhite}" - -# Toggle color blocks -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --color_blocks -color_blocks="on" - -# Color block width in spaces -# -# Default: '3' -# Values: 'num' -# Flag: --block_width -block_width=4 - -# Color block height in lines -# -# Default: '1' -# Values: 'num' -# Flag: --block_height -block_height=1 - - -# Color Alignment -# -# Default: 'auto' -# Values: 'auto', 'num' -# Flag: --col_offset -# -# Number specifies how far from the left side of the terminal (in spaces) to -# begin printing the columns, in case you want to e.g. center them under your -# text. -# Example: -# col_offset="auto" - Default behavior of neofetch -# col_offset=7 - Leave 7 spaces then print the colors -col_offset="auto" - -##--------- Progress Bars - -# Bar characters -# -# Default: '-', '=' -# Values: 'string', 'string' -# Flag: --bar_char -# -# Example: -# neofetch --bar_char 'elapsed' 'total' -# neofetch --bar_char '-' '=' -bar_char_elapsed="-" -bar_char_total="=" - -# Toggle Bar border -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --bar_border -bar_border="on" - -# Progress bar length in spaces -# Number of chars long to make the progress bars. -# -# Default: '15' -# Values: 'num' -# Flag: --bar_length -bar_length=15 - -# Progress bar colors -# When set to distro, uses your distro's logo colors. -# -# Default: 'distro', 'distro' -# Values: 'distro', 'num' -# Flag: --bar_colors -# -# Example: -# neofetch --bar_colors 3 4 -# neofetch --bar_colors distro 5 -bar_color_elapsed="distro" -bar_color_total="distro" - -# Info display -# Display a bar with the info. -# -# Default: 'off' -# Values: 'bar', 'infobar', 'barinfo', 'off' -# Flags: --cpu_display -# --memory_display -# --battery_display -# --disk_display -# -# Example: -# bar: '[---=======]' -# infobar: 'info [---=======]' -# barinfo: '[---=======] info' -# off: 'info' -cpu_display="on" -memory_display="on" -battery_display="on" -disk_display="on" - - -##--------- Backend Settings - -# Image backend. -# -# Default: 'ascii' -# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', -# 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' -# Flag: --backend -image_backend="ascii" - -# Image Source -# -# Which image or ascii file to display. -# -# Default: 'auto' -# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' -# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' -# Flag: --source -# -# NOTE: 'auto' will pick the best image source for whatever image backend is used. -# In ascii mode, distro ascii art will be used and in an image mode, your -# wallpaper will be used. -image_source="auto" - - -##--------- Ascii Options - -# Ascii distro -# Which distro's ascii art to display. -# -# Default: 'auto' -# Values: 'auto', 'distro_name' -# Flag: --ascii_distro -# NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS", -# "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs, -# ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock, -# Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD, -# BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS, -# Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, -# Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin, -# DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary, -# EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD, -# FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo, -# gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, -# Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, -# Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite, -# LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, -# Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib, -# Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner, -# NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba, -# OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD, -# Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint, -# popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix, -# Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan, -# Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific, -# Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz, -# SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS, -# openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, -# Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio, -# Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin, -# and IRIX have ascii logos -# NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants. -# Use '{distro name}_old' to use the old logos. -# NOTE: Ubuntu has flavor variants. -# Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME, -# Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors. -# NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu, -# CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android, -# Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola, -# Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS, -# Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, -# postmarketOS, and Void have a smaller logo variant. -# Use '{distro name}_small' to use the small variants. -ascii_distro="auto" - -# Ascii Colors -# -# Default: 'distro' -# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' -# Flag: --ascii_colors -# -# Example: -# ascii_colors=(distro) - Ascii is colored based on Distro colors. -# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. -ascii_colors=(distro) - -# Bold ascii logo -# Whether or not to bold the ascii logo. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --ascii_bold -ascii_bold="on" - - -##--------- Image Options - -# Image loop -# Setting this to on will make neofetch redraw the image constantly until -# Ctrl+C is pressed. This fixes display issues in some terminal emulators. -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --loop -image_loop="off" - -# Thumbnail directory -# -# Default: '~/.cache/thumbnails/neofetch' -# Values: 'dir' -thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" - -# Crop mode -# -# Default: 'normal' -# Values: 'normal', 'fit', 'fill' -# Flag: --crop_mode -# -# See this wiki page to learn about the fit and fill options. -# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F -crop_mode="normal" - -# Crop offset -# Note: Only affects 'normal' crop mode. -# -# Default: 'center' -# Values: 'northwest', 'north', 'northeast', 'west', 'center' -# 'east', 'southwest', 'south', 'southeast' -# Flag: --crop_offset -crop_offset="center" - -# Image size -# The image is half the terminal width by default. -# -# Default: 'auto' -# Values: 'auto', '00px', '00%', 'none' -# Flags: --image_size -# --size -image_size="auto" - -# Gap between image and text -# -# Default: '3' -# Values: 'num', '-num' -# Flag: --gap -gap=2 - -# Image offsets -# Only works with the w3m backend. -# -# Default: '0' -# Values: 'px' -# Flags: --xoffset -# --yoffset -yoffset=0 -xoffset=0 - -# Image background color -# Only works with the w3m backend. -# -# Default: '' -# Values: 'color', 'blue' -# Flag: --bg_color -background_color= - - -##--------- Misc Options - -# Stdout mode -# Turn off all colors and disables image backend (ASCII/Image). -# Useful for piping into another command. -# Default: 'off' -# Values: 'on', 'off' -stdout="off" diff --git a/reference/hosts/callisto/home.nix b/reference/hosts/callisto/home.nix new file mode 100644 index 0000000..632b1d8 --- /dev/null +++ b/reference/hosts/callisto/home.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ../../../hm/modules + ../../users/youwen + ]; + + home.stateVersion = "24.05"; +} From dbc5fbd87593346b12b3527a15ec45f9d233e207 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 21:54:50 -0800 Subject: [PATCH 26/43] docs: update readme --- README.md | 93 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 3a168fd..b33fb55 100755 --- a/README.md +++ b/README.md @@ -6,15 +6,25 @@ based on [NixOS](https://nixos.org/). Time wasted writing Nix code: ![](https://wakatime.com/badge/user/018dc5b8-ba5a-4572-a38a-b526d1b28240/project/c59b3d5e-0c9c-4bd5-a752-e75522ab0cdc.svg) + [![wakatime](https://wakatime.com/badge/user/018dc5b8-ba5a-4572-a38a-b526d1b28240/project/de5e82f8-8a09-42cb-ae45-9c80f2ab5a41.svg)](https://wakatime.com/badge/user/018dc5b8-ba5a-4572-a38a-b526d1b28240/project/de5e82f8-8a09-42cb-ae45-9c80f2ab5a41) -These are essentially just my NixOS configuration files. I use flakes, -home-manager, `agenix`, all the buzzwords. But it sounds cool to have your own -OS! (and NixOS is essentially a purpose-built language and ecosystem to allow -you to build your own immutable operating system anyways.) +This repository implements a NixOS module that declares the entire liminalOS +operating system. It aims to be an easy way to both set up a brand new system +with my opinionated configurations, and also inject into an existing NixOS +configuration. + +A reference implementation of liminalOS on actual working systems is in +[./reference](./reference). + +liminalOS is currently in a heavily experimental state, and cannot be consumed +directly without much prior work. Development is ongoing to create a fully +self-contained module. Many have written at length about the virtues of NixOS and _declarative configuration_ and _immutability_ and such. I doubt what I have to say is particularly novel, but I'll leave a few thoughts about Nix and NixOS and why -they do things better anyways. In particular, instead of immediately evangelizing about the virtues of Nix, I'll first motivate the reasons for why I chose a tool with exactly its properties, based on my use case (but not to worry, the evangelizing will come later). +they do things better anyways. In particular, instead of immediately +evangelizing about the virtues of Nix, I'll first motivate the reasons for why +I chose a tool with exactly its properties, based on my use case (but not to +worry, the evangelizing will come later). Essentially: allow me to introduce you to the origins of [NixOS God @@ -83,13 +93,15 @@ configurations and applications seems incredibly unwieldy, through our usual conception of how we interact with our operating systems. The more obsessive system tweakers might try a dotfile manager like `chezmoi` -or GNU Stow. I have not tried these so I make no judgements on their utility for their intended purpose, -but generally these solutions miss a key feature: they provide the -configuration, but don't install the software. But the software and the -configuration are fundamentally tied together; these are not concerns to be -separated. If the software is installed, it almost always needs to be -configured anyways. If the configuration exists, the software should be -installed. These solutions may work well for managing configuration, but they have the same issue as before: you also need to install the software you're configuring! +or GNU Stow. I have not tried these so I make no judgements on their utility +for their intended purpose, but generally these solutions miss a key feature: +they provide the configuration, but don't install the software. But the +software and the configuration are fundamentally tied together; these are not +concerns to be separated. If the software is installed, it almost always needs +to be configured anyways. If the configuration exists, the software should be +installed. These solutions may work well for managing configuration, but they +have the same issue as before: you also need to install the software you're +configuring! So, *nix hackers reach for things like [Ansible](https://www.ansible.com/), that promise automatic configuration of entire systems. Though Ansible was designed @@ -102,7 +114,10 @@ which aren't expected to be as ephemeral as servers). If you agree with the premises I've laid out up to this point, you might come to the conclusion that I've made: to solve this issue, we need a solution that does _all of it_. A unified tool for deploying software and managing systems. -And it must necessarily be declarative and reproducible, because that is the only way to sanely manage a system. Imagine working on a programming project where recompiling with the same source code would non-deterministically produce different results based on the environment! +And it must necessarily be declarative and reproducible, because that is the +only way to sanely manage a system. Imagine working on a programming project +where recompiling with the same source code would non-deterministically produce +different results based on the environment! Well, [Nix](https://nixos.org/) is the _purely functional_ package manager (i.e. declarative, reproducible), and NixOS is a Linux distribution that is @@ -159,8 +174,8 @@ versioning (via `git`), and rollbacks _for free_. ## Installation guide -TBD. May use `deploy-rs` or the in-house -[dartgun](https://github.com/youwen5/dartgun) tool for easy deployment. +Currently there is no streamlined installer. Please see [the reference +implementations](./reference) for an idea on how to set up a liminalOS system. ## FAQ @@ -180,9 +195,7 @@ Therefore, liminalOS is a Linux distribution. QED.[^2] ### Should I actually install this? -No. You should instead use the modules as configuration examples if you need -them as they are heavily customized for my needs, which are not the same as -yours. +Sure. ## Hosts @@ -211,25 +224,25 @@ The [flake.nix](/flake.nix) currently contains my configuration for four hosts: although this is not actually how the converse works, the rigor-hungry mathematicians reading can cry about it. -## Keybinds - -Non-exhaustive. - -| Shortcut | Action | -| -------------------------------------------------------------------------------------------------------- | -------------------------------- | -| Super + W | Toggle floating | -| Super + K | Toggle layout | -| Super + E | Open Dolphin | -| Super + T | Open kitty | -| Super + F | Open librewolf | -| Super + R | Open pavucontrol | -| Super + Space | Open rofi | -| Super + Backspace | Open logout menu | -| Super + L | Screenshot region | -| Super + HJKL | Move around | -| Super + Ctrl + HL | Move workspaces | -| Super + Alt + Ctrl + HJKL | Move windows around workspaces | -| Super + Shift + Ctrl + HJKL | Move windows around | -| Super + S | Open Special Workspace | -| Super + Enter | Fullscreen Window | -| Super + Alt + S | Move Window to Special Workspace | + + + + + + + + + + + + + + + + + + + + + + From 8424b025f69c1f41be8be301dd171d24d51ac7e2 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 22:33:04 -0800 Subject: [PATCH 27/43] refactor: do not depend on inputs for modules --- flake.nix | 46 ++++++++++++++------ hm/default.nix | 7 +-- hm/modules/common/shellenv/default.nix | 4 +- hm/modules/linux/platform-tweaks/default.nix | 3 -- hm/modules/linux/programs/default.nix | 6 +-- hm/modules/linux/spicetify/default.nix | 6 +-- modules/linux/flatpak/default.nix | 4 +- modules/linux/misc/default.nix | 3 ++ modules/linux/stylix/default.nix | 39 ++++++++++++++--- modules/linux/wsl/default.nix | 4 +- reference/hosts/demeter/configuration.nix | 4 ++ 11 files changed, 87 insertions(+), 39 deletions(-) diff --git a/flake.nix b/flake.nix index 977e6c4..91290b4 100755 --- a/flake.nix +++ b/flake.nix @@ -118,11 +118,17 @@ # "aarch64-darwin" # aarch64-darwin is currently disabled due to lack of maintenance ]; - flake = { + flake = rec { nixosConfigurations = { - demeter = buildLiminalOS { - inherit inputs nixpkgs; - systemModule = ./reference/hosts/demeter; + demeter = nixpkgs.lib.nixosSystem { + specialArgs = { + liminalSystemModules = nixosModules; + liminalHomeManagerModules = homeManagerModules; + inherit inputs; + }; + modules = [ + ./reference/hosts/demeter + ]; }; callisto = buildLiminalOS { inherit nixpkgs inputs; @@ -145,12 +151,33 @@ ./hosts/phobos ]; }; + + nixosModules = rec { + inherit (inputs) + home-manager + nixos-wsl + stylix + nix-flatpak + ; + default = liminalOS; + liminalOS = ./modules/default.nix; + }; + + homeManagerModules = rec { + inherit (inputs) + spicetify + stylix + nix-index-database + zen-browser + ; + default = liminalOS; + liminalOS = ./hm/modules/default.nix; + }; }; perSystem = { pkgs, system, - config, ... }: { @@ -171,15 +198,6 @@ ]; }; - nixosModules = { - default = config.nixosModules.liminalOS; - liminalOS = ./modules/default.nix; - }; - - homeManagerModules = { - default = config.homeManagerModules.liminalOS; - liminalOS = ./hm/modules/default.nix; - }; }; }; } diff --git a/hm/default.nix b/hm/default.nix index 2c3bf2f..ef23ee1 100644 --- a/hm/default.nix +++ b/hm/default.nix @@ -1,5 +1,6 @@ { - inputs, + liminalHomeManagerModules, + liminalSystemModules, config, lib, ... @@ -9,7 +10,7 @@ let in { imports = [ - inputs.home-manager.nixosModules.home-manager + liminalSystemModules.home-manager.nixosModules.home-manager ]; options.liminalOS.integrateHomeManager = lib.mkOption { @@ -24,6 +25,6 @@ in useGlobalPkgs = true; useUserPackages = true; backupFileExtension = "backup"; - extraSpecialArgs = { inherit inputs; }; + extraSpecialArgs = { inherit liminalHomeManagerModules; }; }; } diff --git a/hm/modules/common/shellenv/default.nix b/hm/modules/common/shellenv/default.nix index a6d1d43..258e3c7 100644 --- a/hm/modules/common/shellenv/default.nix +++ b/hm/modules/common/shellenv/default.nix @@ -1,7 +1,7 @@ { config, lib, - inputs, + liminalHomeManagerModules, pkgs, osConfig, ... @@ -11,7 +11,7 @@ let in { imports = [ - inputs.nix-index-database.hmModules.nix-index + liminalHomeManagerModules.nix-index-database.hmModules.nix-index ./fastfetch ]; diff --git a/hm/modules/linux/platform-tweaks/default.nix b/hm/modules/linux/platform-tweaks/default.nix index 4a389e4..93f4723 100644 --- a/hm/modules/linux/platform-tweaks/default.nix +++ b/hm/modules/linux/platform-tweaks/default.nix @@ -1,5 +1,4 @@ { - inputs, lib, config, osConfig, @@ -25,8 +24,6 @@ in }; config = { - services.tlp.enable = lib.mkIf (cfg.formFactor == "laptop") true; - programs.light.enable = lib.mkIf (cfg.formFactor == "laptop") true; assertions = [ { assertion = cfg.formFactor != null; diff --git a/hm/modules/linux/programs/default.nix b/hm/modules/linux/programs/default.nix index 961a43f..94ccbd3 100644 --- a/hm/modules/linux/programs/default.nix +++ b/hm/modules/linux/programs/default.nix @@ -1,6 +1,6 @@ { pkgs, - inputs, + liminalHomeManagerModules, config, lib, ... @@ -85,11 +85,11 @@ in }; home.packages = lib.mkIf cfg.zen.enable [ - inputs.zen-browser.packages.${pkgs.system}.default + liminalHomeManagerModules.zen-browser.packages.${pkgs.system}.default ]; home.sessionVariables.DEFAULT_BROWSER = lib.mkIf cfg.zen.enable "${ - inputs.zen-browser.packages.${pkgs.system}.default + liminalHomeManagerModules.zen-browser.packages.${pkgs.system}.default }/bin/zen"; }; } diff --git a/hm/modules/linux/spicetify/default.nix b/hm/modules/linux/spicetify/default.nix index 985397e..693e4f4 100644 --- a/hm/modules/linux/spicetify/default.nix +++ b/hm/modules/linux/spicetify/default.nix @@ -1,5 +1,5 @@ { - inputs, + liminalHomeManagerModules, pkgs, config, osConfig, @@ -7,11 +7,11 @@ ... }: let - spicepkgs = inputs.spicetify.legacyPackages.${pkgs.system}; + spicepkgs = liminalHomeManagerModules.spicetify.legacyPackages.${pkgs.system}; in { imports = [ - inputs.spicetify.homeManagerModules.default + liminalHomeManagerModules.spicetify.homeManagerModules.default ]; config = lib.mkIf (config.liminalOS.programs.enable && osConfig.liminalOS.config.allowUnfree) { diff --git a/modules/linux/flatpak/default.nix b/modules/linux/flatpak/default.nix index 6c65c41..f84a150 100644 --- a/modules/linux/flatpak/default.nix +++ b/modules/linux/flatpak/default.nix @@ -3,7 +3,7 @@ # persist between generations. This is not ideal, but at least it is a better # situation than imperative installation { - inputs, + liminalSystemModules, config, lib, ... @@ -13,7 +13,7 @@ let in { imports = [ - inputs.nix-flatpak.nixosModules.nix-flatpak + liminalSystemModules.nix-flatpak.nixosModules.nix-flatpak ]; options.liminalOS.programs.flatpak = { diff --git a/modules/linux/misc/default.nix b/modules/linux/misc/default.nix index b23d6ce..b9af25f 100644 --- a/modules/linux/misc/default.nix +++ b/modules/linux/misc/default.nix @@ -103,6 +103,9 @@ in ) ); + services.tlp.enable = lib.mkIf (cfg.formFactor == "laptop") true; + programs.light.enable = lib.mkIf (cfg.formFactor == "laptop") true; + environment.variables.EDITOR = lib.mkIf ( cfg.defaultEditor != null ) cfg.defaultEditor.meta.mainProgram; diff --git a/modules/linux/stylix/default.nix b/modules/linux/stylix/default.nix index 52bf4db..532e745 100644 --- a/modules/linux/stylix/default.nix +++ b/modules/linux/stylix/default.nix @@ -1,5 +1,5 @@ { - inputs, + liminalSystemModules, pkgs, config, lib, @@ -24,20 +24,45 @@ in Whether to enable plymouth and sane defaults. ''; }; + wallpaper = lib.mkOption { + type = lib.types.path; + default = "../../../hm/modules/common/shellenv/fastfetch/nixos-logo.png"; + description = '' + Path to wallpaper to set as background and generate system colorscehme from. + ''; + }; + polarity = lib.mkOption { + type = lib.types.nullOr ( + lib.types.enum [ + "light" + "dark" + ] + ); + default = null; + description = '' + Whether to force colorscheme to be generated as light or dark theme. Set to null to automatically determine. + ''; + }; + base16Scheme = lib.mkOption { + type = lib.types.nullOr lib.types.path; + default = null; + description = '' + Base 16 colorscheme from base16-schemes to override wallpaper generated colorscheme with. Set to null to use wallpaper generated scheme. + Example: ''${pkgs.base16-schemes}/share/themes/rose-pine.yaml + ''; + }; }; imports = [ - inputs.stylix.nixosModules.stylix + liminalSystemModules.stylix.nixosModules.stylix ]; config = lib.mkIf cfg.enable { stylix = { enable = true; - image = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png"; - # image = "${inputs.wallpapers}/aesthetic/red_deadly_sun.jpg"; - # image = "${inputs.wallpapers}/aesthetic/afterglow_sand_dunes.jpg"; - base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml"; - polarity = "dark"; + image = lib.mkIf (cfg.wallpaper != null) cfg.wallpaper; + base16Scheme = lib.mkIf (cfg.base16Scheme != null) cfg.base16Scheme; + polarity = lib.mkIf (cfg.polarity != null) cfg.polarity; fonts = { serif = { diff --git a/modules/linux/wsl/default.nix b/modules/linux/wsl/default.nix index d2f4416..b0e9d19 100644 --- a/modules/linux/wsl/default.nix +++ b/modules/linux/wsl/default.nix @@ -1,5 +1,5 @@ { - inputs, + liminalSystemModules, config, lib, ... @@ -9,7 +9,7 @@ let in { imports = [ - inputs.nixos-wsl.nixosModules.default + liminalSystemModules.nixos-wsl.nixosModules.default ]; options.liminalOS.wsl = { diff --git a/reference/hosts/demeter/configuration.nix b/reference/hosts/demeter/configuration.nix index aa63bad..8080587 100755 --- a/reference/hosts/demeter/configuration.nix +++ b/reference/hosts/demeter/configuration.nix @@ -19,6 +19,10 @@ config.allowUnfree = true; defaultEditor = inputs.viminal.packages.${pkgs.system}.default; formFactor = "desktop"; + theming = { + wallpaper = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml"; + }; system = { audio.prod.enable = true; networking = { From 4314399a1c694ca36e8523d12235aa6dba82ac35 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 22:50:35 -0800 Subject: [PATCH 28/43] Revert 1 commits 8424b02 'refactor: do not depend on inputs for modules' --- flake.nix | 46 ++++++-------------- hm/default.nix | 7 ++- hm/modules/common/shellenv/default.nix | 4 +- hm/modules/linux/platform-tweaks/default.nix | 3 ++ hm/modules/linux/programs/default.nix | 6 +-- hm/modules/linux/spicetify/default.nix | 6 +-- modules/linux/flatpak/default.nix | 4 +- modules/linux/misc/default.nix | 3 -- modules/linux/stylix/default.nix | 39 +++-------------- modules/linux/wsl/default.nix | 4 +- reference/hosts/demeter/configuration.nix | 4 -- 11 files changed, 39 insertions(+), 87 deletions(-) diff --git a/flake.nix b/flake.nix index 91290b4..977e6c4 100755 --- a/flake.nix +++ b/flake.nix @@ -118,17 +118,11 @@ # "aarch64-darwin" # aarch64-darwin is currently disabled due to lack of maintenance ]; - flake = rec { + flake = { nixosConfigurations = { - demeter = nixpkgs.lib.nixosSystem { - specialArgs = { - liminalSystemModules = nixosModules; - liminalHomeManagerModules = homeManagerModules; - inherit inputs; - }; - modules = [ - ./reference/hosts/demeter - ]; + demeter = buildLiminalOS { + inherit inputs nixpkgs; + systemModule = ./reference/hosts/demeter; }; callisto = buildLiminalOS { inherit nixpkgs inputs; @@ -151,33 +145,12 @@ ./hosts/phobos ]; }; - - nixosModules = rec { - inherit (inputs) - home-manager - nixos-wsl - stylix - nix-flatpak - ; - default = liminalOS; - liminalOS = ./modules/default.nix; - }; - - homeManagerModules = rec { - inherit (inputs) - spicetify - stylix - nix-index-database - zen-browser - ; - default = liminalOS; - liminalOS = ./hm/modules/default.nix; - }; }; perSystem = { pkgs, system, + config, ... }: { @@ -198,6 +171,15 @@ ]; }; + nixosModules = { + default = config.nixosModules.liminalOS; + liminalOS = ./modules/default.nix; + }; + + homeManagerModules = { + default = config.homeManagerModules.liminalOS; + liminalOS = ./hm/modules/default.nix; + }; }; }; } diff --git a/hm/default.nix b/hm/default.nix index ef23ee1..2c3bf2f 100644 --- a/hm/default.nix +++ b/hm/default.nix @@ -1,6 +1,5 @@ { - liminalHomeManagerModules, - liminalSystemModules, + inputs, config, lib, ... @@ -10,7 +9,7 @@ let in { imports = [ - liminalSystemModules.home-manager.nixosModules.home-manager + inputs.home-manager.nixosModules.home-manager ]; options.liminalOS.integrateHomeManager = lib.mkOption { @@ -25,6 +24,6 @@ in useGlobalPkgs = true; useUserPackages = true; backupFileExtension = "backup"; - extraSpecialArgs = { inherit liminalHomeManagerModules; }; + extraSpecialArgs = { inherit inputs; }; }; } diff --git a/hm/modules/common/shellenv/default.nix b/hm/modules/common/shellenv/default.nix index 258e3c7..a6d1d43 100644 --- a/hm/modules/common/shellenv/default.nix +++ b/hm/modules/common/shellenv/default.nix @@ -1,7 +1,7 @@ { config, lib, - liminalHomeManagerModules, + inputs, pkgs, osConfig, ... @@ -11,7 +11,7 @@ let in { imports = [ - liminalHomeManagerModules.nix-index-database.hmModules.nix-index + inputs.nix-index-database.hmModules.nix-index ./fastfetch ]; diff --git a/hm/modules/linux/platform-tweaks/default.nix b/hm/modules/linux/platform-tweaks/default.nix index 93f4723..4a389e4 100644 --- a/hm/modules/linux/platform-tweaks/default.nix +++ b/hm/modules/linux/platform-tweaks/default.nix @@ -1,4 +1,5 @@ { + inputs, lib, config, osConfig, @@ -24,6 +25,8 @@ in }; config = { + services.tlp.enable = lib.mkIf (cfg.formFactor == "laptop") true; + programs.light.enable = lib.mkIf (cfg.formFactor == "laptop") true; assertions = [ { assertion = cfg.formFactor != null; diff --git a/hm/modules/linux/programs/default.nix b/hm/modules/linux/programs/default.nix index 94ccbd3..961a43f 100644 --- a/hm/modules/linux/programs/default.nix +++ b/hm/modules/linux/programs/default.nix @@ -1,6 +1,6 @@ { pkgs, - liminalHomeManagerModules, + inputs, config, lib, ... @@ -85,11 +85,11 @@ in }; home.packages = lib.mkIf cfg.zen.enable [ - liminalHomeManagerModules.zen-browser.packages.${pkgs.system}.default + inputs.zen-browser.packages.${pkgs.system}.default ]; home.sessionVariables.DEFAULT_BROWSER = lib.mkIf cfg.zen.enable "${ - liminalHomeManagerModules.zen-browser.packages.${pkgs.system}.default + inputs.zen-browser.packages.${pkgs.system}.default }/bin/zen"; }; } diff --git a/hm/modules/linux/spicetify/default.nix b/hm/modules/linux/spicetify/default.nix index 693e4f4..985397e 100644 --- a/hm/modules/linux/spicetify/default.nix +++ b/hm/modules/linux/spicetify/default.nix @@ -1,5 +1,5 @@ { - liminalHomeManagerModules, + inputs, pkgs, config, osConfig, @@ -7,11 +7,11 @@ ... }: let - spicepkgs = liminalHomeManagerModules.spicetify.legacyPackages.${pkgs.system}; + spicepkgs = inputs.spicetify.legacyPackages.${pkgs.system}; in { imports = [ - liminalHomeManagerModules.spicetify.homeManagerModules.default + inputs.spicetify.homeManagerModules.default ]; config = lib.mkIf (config.liminalOS.programs.enable && osConfig.liminalOS.config.allowUnfree) { diff --git a/modules/linux/flatpak/default.nix b/modules/linux/flatpak/default.nix index f84a150..6c65c41 100644 --- a/modules/linux/flatpak/default.nix +++ b/modules/linux/flatpak/default.nix @@ -3,7 +3,7 @@ # persist between generations. This is not ideal, but at least it is a better # situation than imperative installation { - liminalSystemModules, + inputs, config, lib, ... @@ -13,7 +13,7 @@ let in { imports = [ - liminalSystemModules.nix-flatpak.nixosModules.nix-flatpak + inputs.nix-flatpak.nixosModules.nix-flatpak ]; options.liminalOS.programs.flatpak = { diff --git a/modules/linux/misc/default.nix b/modules/linux/misc/default.nix index b9af25f..b23d6ce 100644 --- a/modules/linux/misc/default.nix +++ b/modules/linux/misc/default.nix @@ -103,9 +103,6 @@ in ) ); - services.tlp.enable = lib.mkIf (cfg.formFactor == "laptop") true; - programs.light.enable = lib.mkIf (cfg.formFactor == "laptop") true; - environment.variables.EDITOR = lib.mkIf ( cfg.defaultEditor != null ) cfg.defaultEditor.meta.mainProgram; diff --git a/modules/linux/stylix/default.nix b/modules/linux/stylix/default.nix index 532e745..52bf4db 100644 --- a/modules/linux/stylix/default.nix +++ b/modules/linux/stylix/default.nix @@ -1,5 +1,5 @@ { - liminalSystemModules, + inputs, pkgs, config, lib, @@ -24,45 +24,20 @@ in Whether to enable plymouth and sane defaults. ''; }; - wallpaper = lib.mkOption { - type = lib.types.path; - default = "../../../hm/modules/common/shellenv/fastfetch/nixos-logo.png"; - description = '' - Path to wallpaper to set as background and generate system colorscehme from. - ''; - }; - polarity = lib.mkOption { - type = lib.types.nullOr ( - lib.types.enum [ - "light" - "dark" - ] - ); - default = null; - description = '' - Whether to force colorscheme to be generated as light or dark theme. Set to null to automatically determine. - ''; - }; - base16Scheme = lib.mkOption { - type = lib.types.nullOr lib.types.path; - default = null; - description = '' - Base 16 colorscheme from base16-schemes to override wallpaper generated colorscheme with. Set to null to use wallpaper generated scheme. - Example: ''${pkgs.base16-schemes}/share/themes/rose-pine.yaml - ''; - }; }; imports = [ - liminalSystemModules.stylix.nixosModules.stylix + inputs.stylix.nixosModules.stylix ]; config = lib.mkIf cfg.enable { stylix = { enable = true; - image = lib.mkIf (cfg.wallpaper != null) cfg.wallpaper; - base16Scheme = lib.mkIf (cfg.base16Scheme != null) cfg.base16Scheme; - polarity = lib.mkIf (cfg.polarity != null) cfg.polarity; + image = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png"; + # image = "${inputs.wallpapers}/aesthetic/red_deadly_sun.jpg"; + # image = "${inputs.wallpapers}/aesthetic/afterglow_sand_dunes.jpg"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml"; + polarity = "dark"; fonts = { serif = { diff --git a/modules/linux/wsl/default.nix b/modules/linux/wsl/default.nix index b0e9d19..d2f4416 100644 --- a/modules/linux/wsl/default.nix +++ b/modules/linux/wsl/default.nix @@ -1,5 +1,5 @@ { - liminalSystemModules, + inputs, config, lib, ... @@ -9,7 +9,7 @@ let in { imports = [ - liminalSystemModules.nixos-wsl.nixosModules.default + inputs.nixos-wsl.nixosModules.default ]; options.liminalOS.wsl = { diff --git a/reference/hosts/demeter/configuration.nix b/reference/hosts/demeter/configuration.nix index 8080587..aa63bad 100755 --- a/reference/hosts/demeter/configuration.nix +++ b/reference/hosts/demeter/configuration.nix @@ -19,10 +19,6 @@ config.allowUnfree = true; defaultEditor = inputs.viminal.packages.${pkgs.system}.default; formFactor = "desktop"; - theming = { - wallpaper = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png"; - base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml"; - }; system = { audio.prod.enable = true; networking = { From d66cce9fa13bef9ab995e76da548315f0254107f Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 22:50:58 -0800 Subject: [PATCH 29/43] fix: move tlp and light configurations to the right place --- hm/modules/linux/platform-tweaks/default.nix | 2 -- modules/linux/core/default.nix | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hm/modules/linux/platform-tweaks/default.nix b/hm/modules/linux/platform-tweaks/default.nix index 4a389e4..f3ab7e4 100644 --- a/hm/modules/linux/platform-tweaks/default.nix +++ b/hm/modules/linux/platform-tweaks/default.nix @@ -25,8 +25,6 @@ in }; config = { - services.tlp.enable = lib.mkIf (cfg.formFactor == "laptop") true; - programs.light.enable = lib.mkIf (cfg.formFactor == "laptop") true; assertions = [ { assertion = cfg.formFactor != null; diff --git a/modules/linux/core/default.nix b/modules/linux/core/default.nix index cc88d2a..ed06c1b 100644 --- a/modules/linux/core/default.nix +++ b/modules/linux/core/default.nix @@ -183,6 +183,9 @@ in programs.fish.enable = true; + services.tlp.enable = lib.mkIf (cfg.formFactor == "laptop") true; + programs.light.enable = lib.mkIf (cfg.formFactor == "laptop") true; + hardware.bluetooth = lib.mkIf cfg.bluetooth.enable { enable = true; powerOnBoot = true; From e9c6c54ee16f83b4a0b2ef16c5f83fb08518b268 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 23:11:43 -0800 Subject: [PATCH 30/43] feat: bundle external nixosModules with liminalOS module --- flake.nix | 54 +++++++++++++++++++------- hm/default.nix | 4 -- hm/modules/common/shellenv/default.nix | 2 - hm/modules/linux/spicetify/default.nix | 10 +---- modules/default.nix | 1 + modules/linux/core/default.nix | 4 +- modules/linux/flatpak/default.nix | 4 -- modules/linux/stylix/default.nix | 4 -- modules/linux/wsl/default.nix | 4 -- reference/hosts/demeter/default.nix | 4 +- reference/users/youwen/default.nix | 3 +- 11 files changed, 49 insertions(+), 45 deletions(-) diff --git a/flake.nix b/flake.nix index 977e6c4..88c8cb4 100755 --- a/flake.nix +++ b/flake.nix @@ -106,6 +106,7 @@ nixpkgs, nix-darwin, flake-parts, + self, ... }: let @@ -120,9 +121,13 @@ ]; flake = { nixosConfigurations = { - demeter = buildLiminalOS { - inherit inputs nixpkgs; - systemModule = ./reference/hosts/demeter; + demeter = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs self; + }; + modules = [ + ./reference/hosts/demeter + ]; }; callisto = buildLiminalOS { inherit nixpkgs inputs; @@ -145,6 +150,39 @@ ./hosts/phobos ]; }; + + nixosModules = rec { + default = liminalOS; + liminalOS = { + imports = [ + inputs.nix-flatpak.nixosModules.nix-flatpak + inputs.home-manager.nixosModules.home-manager + inputs.nixos-wsl.nixosModules.default + inputs.stylix.nixosModules.stylix + ./modules/default.nix + ( + { pkgs, ... }: + { + home-manager.extraSpecialArgs = { + spicepkgs = inputs.spicetify.legacyPackages.${pkgs.system}; + inherit inputs self; + }; + } + ) + ]; + }; + }; + + homeManagerModules = rec { + default = liminalOS; + liminalOS = { + imports = [ + inputs.nix-index-database.hmModules.nix-index + inputs.spicetify.homeManagerModules.default + ./hm/modules/default.nix + ]; + }; + }; }; perSystem = { @@ -170,16 +208,6 @@ inputs.viminal.packages.${system}.default ]; }; - - nixosModules = { - default = config.nixosModules.liminalOS; - liminalOS = ./modules/default.nix; - }; - - homeManagerModules = { - default = config.homeManagerModules.liminalOS; - liminalOS = ./hm/modules/default.nix; - }; }; }; } diff --git a/hm/default.nix b/hm/default.nix index 2c3bf2f..c8fac7c 100644 --- a/hm/default.nix +++ b/hm/default.nix @@ -8,10 +8,6 @@ let cfg = config.liminalOS; in { - imports = [ - inputs.home-manager.nixosModules.home-manager - ]; - options.liminalOS.integrateHomeManager = lib.mkOption { type = lib.types.bool; default = cfg.enable; diff --git a/hm/modules/common/shellenv/default.nix b/hm/modules/common/shellenv/default.nix index a6d1d43..c53e52a 100644 --- a/hm/modules/common/shellenv/default.nix +++ b/hm/modules/common/shellenv/default.nix @@ -1,7 +1,6 @@ { config, lib, - inputs, pkgs, osConfig, ... @@ -11,7 +10,6 @@ let in { imports = [ - inputs.nix-index-database.hmModules.nix-index ./fastfetch ]; diff --git a/hm/modules/linux/spicetify/default.nix b/hm/modules/linux/spicetify/default.nix index 985397e..8b43605 100644 --- a/hm/modules/linux/spicetify/default.nix +++ b/hm/modules/linux/spicetify/default.nix @@ -1,19 +1,11 @@ { - inputs, - pkgs, + spicepkgs, config, osConfig, lib, ... }: -let - spicepkgs = inputs.spicetify.legacyPackages.${pkgs.system}; -in { - imports = [ - inputs.spicetify.homeManagerModules.default - ]; - config = lib.mkIf (config.liminalOS.programs.enable && osConfig.liminalOS.config.allowUnfree) { programs.spicetify = { enable = true; diff --git a/modules/default.nix b/modules/default.nix index 0f342f8..e2f8919 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -10,6 +10,7 @@ in { imports = [ ./linux + ../hm ]; options.liminalOS = { darwin.enable = lib.mkOption { diff --git a/modules/linux/core/default.nix b/modules/linux/core/default.nix index ed06c1b..56517dd 100644 --- a/modules/linux/core/default.nix +++ b/modules/linux/core/default.nix @@ -183,8 +183,8 @@ in programs.fish.enable = true; - services.tlp.enable = lib.mkIf (cfg.formFactor == "laptop") true; - programs.light.enable = lib.mkIf (cfg.formFactor == "laptop") true; + services.tlp.enable = lib.mkIf (config.liminalOS.formFactor == "laptop") true; + programs.light.enable = lib.mkIf (config.liminalOS.formFactor == "laptop") true; hardware.bluetooth = lib.mkIf cfg.bluetooth.enable { enable = true; diff --git a/modules/linux/flatpak/default.nix b/modules/linux/flatpak/default.nix index 6c65c41..872cda5 100644 --- a/modules/linux/flatpak/default.nix +++ b/modules/linux/flatpak/default.nix @@ -12,10 +12,6 @@ let cfg = config.liminalOS.programs.flatpak; in { - imports = [ - inputs.nix-flatpak.nixosModules.nix-flatpak - ]; - options.liminalOS.programs.flatpak = { enable = lib.mkOption { type = lib.types.bool; diff --git a/modules/linux/stylix/default.nix b/modules/linux/stylix/default.nix index 52bf4db..aa8d32a 100644 --- a/modules/linux/stylix/default.nix +++ b/modules/linux/stylix/default.nix @@ -26,10 +26,6 @@ in }; }; - imports = [ - inputs.stylix.nixosModules.stylix - ]; - config = lib.mkIf cfg.enable { stylix = { enable = true; diff --git a/modules/linux/wsl/default.nix b/modules/linux/wsl/default.nix index d2f4416..3c90fdf 100644 --- a/modules/linux/wsl/default.nix +++ b/modules/linux/wsl/default.nix @@ -8,10 +8,6 @@ let cfg = config.liminalOS.wsl; in { - imports = [ - inputs.nixos-wsl.nixosModules.default - ]; - options.liminalOS.wsl = { enable = lib.mkEnableOption "WSL"; }; diff --git a/reference/hosts/demeter/default.nix b/reference/hosts/demeter/default.nix index 279603c..f0559a6 100644 --- a/reference/hosts/demeter/default.nix +++ b/reference/hosts/demeter/default.nix @@ -1,13 +1,13 @@ { inputs, + self, ... }: { imports = [ ./configuration.nix - ../../../modules/linux - ../../../hm + self.nixosModules.liminalOS ../../../overlays { home-manager.users.youwen = { diff --git a/reference/users/youwen/default.nix b/reference/users/youwen/default.nix index a133346..f7dcbb8 100644 --- a/reference/users/youwen/default.nix +++ b/reference/users/youwen/default.nix @@ -1,6 +1,7 @@ +{ self, ... }: { imports = [ - ../../../hm/modules + self.homeManagerModules.liminalOS ]; home = { From 6590279a6825a3276326078833657ea440182d51 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 23:37:17 -0800 Subject: [PATCH 31/43] feat: configure wallpaper, polarity, colorscheme options --- modules/linux/stylix/default.nix | 36 ++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/modules/linux/stylix/default.nix b/modules/linux/stylix/default.nix index aa8d32a..ec93226 100644 --- a/modules/linux/stylix/default.nix +++ b/modules/linux/stylix/default.nix @@ -1,5 +1,4 @@ { - inputs, pkgs, config, lib, @@ -24,16 +23,41 @@ in Whether to enable plymouth and sane defaults. ''; }; + wallpaper = lib.mkOption { + type = lib.types.path; + default = "../../../hm/modules/common/shellenv/fastfetch/nixos-logo.png"; + description = '' + Path to wallpaper to set as background and generate system colorscehme from. + ''; + }; + polarity = lib.mkOption { + type = lib.types.nullOr ( + lib.types.enum [ + "light" + "dark" + ] + ); + default = null; + description = '' + Whether to force colorscheme to be generated as light or dark theme. Set to null to automatically determine. + ''; + }; + base16Scheme = lib.mkOption { + type = lib.types.nullOr lib.types.path; + default = null; + description = '' + Base 16 colorscheme from base16-schemes to override wallpaper generated colorscheme with. Set to null to use wallpaper generated scheme. + Example: ''${pkgs.base16-schemes}/share/themes/rose-pine.yaml + ''; + }; }; config = lib.mkIf cfg.enable { stylix = { enable = true; - image = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png"; - # image = "${inputs.wallpapers}/aesthetic/red_deadly_sun.jpg"; - # image = "${inputs.wallpapers}/aesthetic/afterglow_sand_dunes.jpg"; - base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml"; - polarity = "dark"; + image = lib.mkIf (cfg.wallpaper != null) cfg.wallpaper; + base16Scheme = lib.mkIf (cfg.base16Scheme != null) cfg.base16Scheme; + polarity = lib.mkIf (cfg.polarity != null) cfg.polarity; fonts = { serif = { From 6fdc88a8540d81c7ad2d17c20788b188a290ab27 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 23:49:27 -0800 Subject: [PATCH 32/43] refactor: use overlay to inject zen-browser into package set --- flake.nix | 5 +++++ hm/modules/linux/programs/default.nix | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 88c8cb4..ecffa1d 100755 --- a/flake.nix +++ b/flake.nix @@ -167,6 +167,11 @@ spicepkgs = inputs.spicetify.legacyPackages.${pkgs.system}; inherit inputs self; }; + nixpkgs.overlays = [ + (final: prev: { + zen-browser = inputs.zen-browser.packages.${pkgs.system}.default; + }) + ]; } ) ]; diff --git a/hm/modules/linux/programs/default.nix b/hm/modules/linux/programs/default.nix index 961a43f..280c715 100644 --- a/hm/modules/linux/programs/default.nix +++ b/hm/modules/linux/programs/default.nix @@ -85,11 +85,9 @@ in }; home.packages = lib.mkIf cfg.zen.enable [ - inputs.zen-browser.packages.${pkgs.system}.default + pkgs.zen-browser ]; - home.sessionVariables.DEFAULT_BROWSER = lib.mkIf cfg.zen.enable "${ - inputs.zen-browser.packages.${pkgs.system}.default - }/bin/zen"; + home.sessionVariables.DEFAULT_BROWSER = lib.mkIf cfg.zen.enable "${pkgs.zen-browser}/bin/zen"; }; } From 3a64bae4279391b1cf68b0fec3d6649d1b017747 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 23:49:43 -0800 Subject: [PATCH 33/43] fix: add new options to reference distribution --- reference/hosts/demeter/configuration.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reference/hosts/demeter/configuration.nix b/reference/hosts/demeter/configuration.nix index aa63bad..fe7607e 100755 --- a/reference/hosts/demeter/configuration.nix +++ b/reference/hosts/demeter/configuration.nix @@ -8,17 +8,20 @@ }: { imports = [ - # Include the results of the hardware scan. ./hardware-configuration.nix ]; - networking.hostName = "demeter"; # Define your hostname. + networking.hostName = "demeter"; liminalOS = { flakeLocation = "/home/youwen/.config/liminalOS"; config.allowUnfree = true; defaultEditor = inputs.viminal.packages.${pkgs.system}.default; formFactor = "desktop"; + theming = { + wallpaper = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml"; + }; system = { audio.prod.enable = true; networking = { From 257c076a9b3518cfb88550468995984885ed491f Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 23:51:25 -0800 Subject: [PATCH 34/43] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'home-manager': 'github:nix-community/home-manager/1395379a7a36e40f2a76e7b9936cc52950baa1be?narHash=sha256-OOfI0XhSJGHblfdNDhfnn8QnZxng63rWk9eeJ2tCbiI%3D' (2024-12-19) → 'github:nix-community/home-manager/35b98d20ca8f4ca1f6a2c30b8a2c8bb305a36d84?narHash=sha256-Gm%2B0DcbUS338vvkwyYWms5jsWlx8z8MeQBzcnIDuIkw%3D' (2024-12-24) • Updated input 'homebrew-cask': 'github:homebrew/homebrew-cask/74758b1c17c30a7a770ae83273c3e7320744fc5b?narHash=sha256-P0pbalUNSGxqal9BkE2lY%2BlzTXVRkCl7kSPFGMLG%2BF0%3D' (2024-12-20) → 'github:homebrew/homebrew-cask/d09f0821745ef07e44475831752463736fa1ff0d?narHash=sha256-IyRULXbkFFVGhOmds9m%2BC9mDA//S2RkI4X0bWAsStJs%3D' (2024-12-26) • Updated input 'homebrew-core': 'github:homebrew/homebrew-core/0e39b9bf27c1fc0d4da71971e7a056871e00b358?narHash=sha256-g3c82plQuphjH9cZgDcgdoFLVdsaKvgTa0%2BlpVHfBD0%3D' (2024-12-20) → 'github:homebrew/homebrew-core/b477cfe34c1dcae78eb43b7ecd0d89b854719f1e?narHash=sha256-aJkGLhmz5ucc1BFfAbIWANzd8fiLoCu0aOrnMoLypSQ%3D' (2024-12-26) • Updated input 'nix-flatpak': 'github:gmodena/nix-flatpak/8bdc2540da516006d07b04019eb57ae0781a04b3?narHash=sha256-HLwdVNxpuTsLlM3tCkpbQU6yCehdgf3kOS1G2SDlkzY%3D' (2024-12-13) → 'github:gmodena/nix-flatpak/13be795cac27df7044a425c0b2de3a42b10ddb18?narHash=sha256-8SCTJhDH1fdNGGFhuGStIqbO7vwUKQokgQu6nQlQagY%3D' (2024-12-22) • Updated input 'nix-index-database': 'github:nix-community/nix-index-database/311d6cf3ad3f56cb051ffab1f480b2909b3f754d?narHash=sha256-icEMqBt4HtGH52PU5FHidgBrNJvOfXH6VQKNtnD1aw8%3D' (2024-12-15) → 'github:nix-community/nix-index-database/c8470746a9f4d1ab4c7563db7da995595ed64ca2?narHash=sha256-zD8ciZm42wi1ijHyS7J0dmBE3QXMA/qBfwW/SEXhiwI%3D' (2024-12-25) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/d3c42f187194c26d9f0309a8ecc469d6c878ce33?narHash=sha256-cHar1vqHOOyC7f1%2BtVycPoWTfKIaqkoe1Q6TnKzuti4%3D' (2024-12-17) → 'github:nixos/nixpkgs/d70bd19e0a38ad4790d3913bf08fcbfc9eeca507?narHash=sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ%3D' (2024-12-19) • Updated input 'spicetify': 'github:Gerg-L/spicetify-nix/b7f569e0d97a66d256b93fd88f9e14c5d81d1972?narHash=sha256-LpqK4EQSzv/UDlIognrWRfvaUu6i14i3MDAOKJjlWzY%3D' (2024-12-20) → 'github:Gerg-L/spicetify-nix/112da8f6b8a3365cf89d5c5b6aaa02ba249373ff?narHash=sha256-PQIAL/dODi9HroSaW/4nqWQe2CSTgxRYS%2BXiYPo1FhA%3D' (2024-12-26) • Updated input 'stylix': 'github:danth/stylix/a2d66f25478103ac9b4adc6d6713794f7005221e?narHash=sha256-BWwJTAiWmZudUdUbyets7e3zQfjvZYtkU51blBnUBjw%3D' (2024-12-18) → 'github:danth/stylix/079fecebad5f616561726359c89cedd811c8a722?narHash=sha256-sJ1/y4aXAZ22trJjY%2BnH/bJ%2BpydaDKf3wZtafM%2BYjcs%3D' (2024-12-25) • Updated input 'ucode': 'github:e-tho/ucodenix/a70edcafd9a93b8df1d32e664de921669420024e?narHash=sha256-d2Pc1JUcwRRI5nt5Jk5%2BteIjhLhUaq8i4r2FGuE5/bE%3D' (2024-12-16) → 'github:e-tho/ucodenix/e672b17a0991427328efbbca8dc88ea855888709?narHash=sha256-2BoHRzShQYseyY1eNlHAlFLGZVJqWbCnW3F4BZMWyiU%3D' (2024-12-23) • Updated input 'ucode/cpu-microcodes': 'github:platomav/CPUMicrocodes/bebd9ed9a3c3c21996eb77373d3408296b0b9d3d?narHash=sha256-fdS2hRAgWEukflu2eOpCXe3cVg0L0lcRqdxbLOiMZg0%3D' (2024-12-14) → 'github:platomav/CPUMicrocodes/9953c622cc5555b88cb73f042a78bbc8e0edc587?narHash=sha256-nLxzu0X1txVOu7LxadpOLL%2BEbcS6FCI/xrulsqglMg4%3D' (2024-12-22) • Updated input 'zen-browser': 'github:youwen5/zen-browser-flake/8c8af380bf45b42ae14b2f6d5252be3627332f23?narHash=sha256-vluyzRt6RikEn78Yk0t7Qd96iZZfyRBt4%2BESI0mtlhk%3D' (2024-12-20) → 'github:youwen5/zen-browser-flake/3e4af3607e303a88169782471a082857a3e80162?narHash=sha256-FCQFeOhVg/SNOCdryvxVd/5eLqwXwVr6/48Xyh7wpwU%3D' (2024-12-25) • Updated input 'zen-browser/zen-browser-aarch64': 'https://github.com/zen-browser/desktop/releases/download/1.0.2-b.3/zen.linux-aarch64.tar.bz2?narHash=sha256-F5FwGqAgL4kfEy5rNWvofRQl8SH0udQvEIMhysRMDgs%3D' (2024-12-19) → 'https://github.com/zen-browser/desktop/releases/download/1.0.2-b.5/zen.linux-aarch64.tar.bz2?narHash=sha256-nuGSRzwBloFwgNCIbc5xv3vGkiHQxzOQr4FUX4Cip7Y%3D' (2024-12-24) • Removed input 'zen-browser/zen-browser-generic' • Removed input 'zen-browser/zen-browser-specific' • Added input 'zen-browser/zen-browser-x86_64': 'https://github.com/zen-browser/desktop/releases/download/1.0.2-b.5/zen.linux-x86_64.tar.bz2?narHash=sha256-sS9phyr97WawxB2AZAwcXkvO3xAmv8k4C8b8Qw364PY%3D' (2024-12-24) --- flake.lock | 102 +++++++++++++++++++++++------------------------------ 1 file changed, 44 insertions(+), 58 deletions(-) diff --git a/flake.lock b/flake.lock index 4157f92..12590d2 100644 --- a/flake.lock +++ b/flake.lock @@ -124,17 +124,17 @@ "cpu-microcodes": { "flake": false, "locked": { - "lastModified": 1734191706, - "narHash": "sha256-fdS2hRAgWEukflu2eOpCXe3cVg0L0lcRqdxbLOiMZg0=", + "lastModified": 1734880358, + "narHash": "sha256-nLxzu0X1txVOu7LxadpOLL+EbcS6FCI/xrulsqglMg4=", "owner": "platomav", "repo": "CPUMicrocodes", - "rev": "bebd9ed9a3c3c21996eb77373d3408296b0b9d3d", + "rev": "9953c622cc5555b88cb73f042a78bbc8e0edc587", "type": "github" }, "original": { "owner": "platomav", "repo": "CPUMicrocodes", - "rev": "bebd9ed9a3c3c21996eb77373d3408296b0b9d3d", + "rev": "9953c622cc5555b88cb73f042a78bbc8e0edc587", "type": "github" } }, @@ -395,11 +395,11 @@ ] }, "locked": { - "lastModified": 1734622215, - "narHash": "sha256-OOfI0XhSJGHblfdNDhfnn8QnZxng63rWk9eeJ2tCbiI=", + "lastModified": 1735053786, + "narHash": "sha256-Gm+0DcbUS338vvkwyYWms5jsWlx8z8MeQBzcnIDuIkw=", "owner": "nix-community", "repo": "home-manager", - "rev": "1395379a7a36e40f2a76e7b9936cc52950baa1be", + "rev": "35b98d20ca8f4ca1f6a2c30b8a2c8bb305a36d84", "type": "github" }, "original": { @@ -432,11 +432,11 @@ "homebrew-cask": { "flake": false, "locked": { - "lastModified": 1734689278, - "narHash": "sha256-P0pbalUNSGxqal9BkE2lY+lzTXVRkCl7kSPFGMLG+F0=", + "lastModified": 1735197978, + "narHash": "sha256-IyRULXbkFFVGhOmds9m+C9mDA//S2RkI4X0bWAsStJs=", "owner": "homebrew", "repo": "homebrew-cask", - "rev": "74758b1c17c30a7a770ae83273c3e7320744fc5b", + "rev": "d09f0821745ef07e44475831752463736fa1ff0d", "type": "github" }, "original": { @@ -448,11 +448,11 @@ "homebrew-core": { "flake": false, "locked": { - "lastModified": 1734686007, - "narHash": "sha256-g3c82plQuphjH9cZgDcgdoFLVdsaKvgTa0+lpVHfBD0=", + "lastModified": 1735199084, + "narHash": "sha256-aJkGLhmz5ucc1BFfAbIWANzd8fiLoCu0aOrnMoLypSQ=", "owner": "homebrew", "repo": "homebrew-core", - "rev": "0e39b9bf27c1fc0d4da71971e7a056871e00b358", + "rev": "b477cfe34c1dcae78eb43b7ecd0d89b854719f1e", "type": "github" }, "original": { @@ -530,11 +530,11 @@ }, "nix-flatpak": { "locked": { - "lastModified": 1734128415, - "narHash": "sha256-HLwdVNxpuTsLlM3tCkpbQU6yCehdgf3kOS1G2SDlkzY=", + "lastModified": 1734864618, + "narHash": "sha256-8SCTJhDH1fdNGGFhuGStIqbO7vwUKQokgQu6nQlQagY=", "owner": "gmodena", "repo": "nix-flatpak", - "rev": "8bdc2540da516006d07b04019eb57ae0781a04b3", + "rev": "13be795cac27df7044a425c0b2de3a42b10ddb18", "type": "github" }, "original": { @@ -573,11 +573,11 @@ ] }, "locked": { - "lastModified": 1734234111, - "narHash": "sha256-icEMqBt4HtGH52PU5FHidgBrNJvOfXH6VQKNtnD1aw8=", + "lastModified": 1735160596, + "narHash": "sha256-zD8ciZm42wi1ijHyS7J0dmBE3QXMA/qBfwW/SEXhiwI=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "311d6cf3ad3f56cb051ffab1f480b2909b3f754d", + "rev": "c8470746a9f4d1ab4c7563db7da995595ed64ca2", "type": "github" }, "original": { @@ -656,11 +656,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1734424634, - "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", + "lastModified": 1734649271, + "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33", + "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507", "type": "github" }, "original": { @@ -835,11 +835,11 @@ ] }, "locked": { - "lastModified": 1734668189, - "narHash": "sha256-LpqK4EQSzv/UDlIognrWRfvaUu6i14i3MDAOKJjlWzY=", + "lastModified": 1735186564, + "narHash": "sha256-PQIAL/dODi9HroSaW/4nqWQe2CSTgxRYS+XiYPo1FhA=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "b7f569e0d97a66d256b93fd88f9e14c5d81d1972", + "rev": "112da8f6b8a3365cf89d5c5b6aaa02ba249373ff", "type": "github" }, "original": { @@ -865,11 +865,11 @@ "tinted-tmux": "tinted-tmux" }, "locked": { - "lastModified": 1734531336, - "narHash": "sha256-BWwJTAiWmZudUdUbyets7e3zQfjvZYtkU51blBnUBjw=", + "lastModified": 1735151068, + "narHash": "sha256-sJ1/y4aXAZ22trJjY+nH/bJ+pydaDKf3wZtafM+Yjcs=", "owner": "danth", "repo": "stylix", - "rev": "a2d66f25478103ac9b4adc6d6713794f7005221e", + "rev": "079fecebad5f616561726359c89cedd811c8a722", "type": "github" }, "original": { @@ -993,11 +993,11 @@ "cpu-microcodes": "cpu-microcodes" }, "locked": { - "lastModified": 1734353399, - "narHash": "sha256-d2Pc1JUcwRRI5nt5Jk5+teIjhLhUaq8i4r2FGuE5/bE=", + "lastModified": 1734918967, + "narHash": "sha256-2BoHRzShQYseyY1eNlHAlFLGZVJqWbCnW3F4BZMWyiU=", "owner": "e-tho", "repo": "ucodenix", - "rev": "a70edcafd9a93b8df1d32e664de921669420024e", + "rev": "e672b17a0991427328efbbca8dc88ea855888709", "type": "github" }, "original": { @@ -1103,15 +1103,14 @@ "nixpkgs" ], "zen-browser-aarch64": "zen-browser-aarch64", - "zen-browser-generic": "zen-browser-generic", - "zen-browser-specific": "zen-browser-specific" + "zen-browser-x86_64": "zen-browser-x86_64" }, "locked": { - "lastModified": 1734667644, - "narHash": "sha256-vluyzRt6RikEn78Yk0t7Qd96iZZfyRBt4+ESI0mtlhk=", + "lastModified": 1735099614, + "narHash": "sha256-FCQFeOhVg/SNOCdryvxVd/5eLqwXwVr6/48Xyh7wpwU=", "owner": "youwen5", "repo": "zen-browser-flake", - "rev": "8c8af380bf45b42ae14b2f6d5252be3627332f23", + "rev": "3e4af3607e303a88169782471a082857a3e80162", "type": "github" }, "original": { @@ -1123,40 +1122,27 @@ "zen-browser-aarch64": { "flake": false, "locked": { - "lastModified": 1734641206, - "narHash": "sha256-F5FwGqAgL4kfEy5rNWvofRQl8SH0udQvEIMhysRMDgs=", + "lastModified": 1735043335, + "narHash": "sha256-nuGSRzwBloFwgNCIbc5xv3vGkiHQxzOQr4FUX4Cip7Y=", "type": "tarball", - "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.3/zen.linux-aarch64.tar.bz2" + "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.5/zen.linux-aarch64.tar.bz2" }, "original": { "type": "tarball", - "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.3/zen.linux-aarch64.tar.bz2" + "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.5/zen.linux-aarch64.tar.bz2" } }, - "zen-browser-generic": { + "zen-browser-x86_64": { "flake": false, "locked": { - "lastModified": 1734646830, - "narHash": "sha256-slIWuEWSV9PK1JTr6UKKC+VP4oLNaczwkxkYiqcjZM8=", + "lastModified": 1735049411, + "narHash": "sha256-sS9phyr97WawxB2AZAwcXkvO3xAmv8k4C8b8Qw364PY=", "type": "tarball", - "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.3/zen.linux-generic.tar.bz2" + "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.5/zen.linux-x86_64.tar.bz2" }, "original": { "type": "tarball", - "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.3/zen.linux-generic.tar.bz2" - } - }, - "zen-browser-specific": { - "flake": false, - "locked": { - "lastModified": 1734645803, - "narHash": "sha256-zAo93sHeB8cTW2JBAqxx0wo3CANcxCgjEcTQgbDeWT4=", - "type": "tarball", - "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.3/zen.linux-specific.tar.bz2" - }, - "original": { - "type": "tarball", - "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.3/zen.linux-specific.tar.bz2" + "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.5/zen.linux-x86_64.tar.bz2" } } }, From b0ee9e358c5e74c3ddd763cd62c329fdc608a5f9 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 26 Dec 2024 00:14:47 -0800 Subject: [PATCH 35/43] chore: remove unused config parameter --- flake.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/flake.nix b/flake.nix index ecffa1d..6ae85ab 100755 --- a/flake.nix +++ b/flake.nix @@ -193,7 +193,6 @@ { pkgs, system, - config, ... }: { From 45a9469372f30902f9f3e2f7be19a8d933a7df33 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 26 Dec 2024 00:14:54 -0800 Subject: [PATCH 36/43] fix: use correct format for git safe.directory --- hm/modules/common/shellenv/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hm/modules/common/shellenv/default.nix b/hm/modules/common/shellenv/default.nix index c53e52a..fa050e5 100644 --- a/hm/modules/common/shellenv/default.nix +++ b/hm/modules/common/shellenv/default.nix @@ -49,9 +49,9 @@ in maintenance.enable = true; extraConfig = { init.defaultBranch = "main"; - safe.directory = [ - osConfig.liminalOS.flakeLocation - ]; + safe.directory = lib.mkIf ( + osConfig.liminalOS.flakeLocation != null + ) osConfig.liminalOS.flakeLocation; }; }; From ae1716b328645095b1d717bd495b8255118eb02f Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 26 Dec 2024 00:17:24 -0800 Subject: [PATCH 37/43] fix: remove reference to viminal, use defaultEditor --- modules/linux/core/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/linux/core/default.nix b/modules/linux/core/default.nix index 56517dd..6f58fac 100644 --- a/modules/linux/core/default.nix +++ b/modules/linux/core/default.nix @@ -81,7 +81,7 @@ in curl ] ++ [ - inputs.viminal.packages.${pkgs.system}.default + config.liminalOS.defaultEditor ]; # tells electron apps to use Wayland From 9357bc35aa2cd0e150713d1e8d628656d5e935de Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 26 Dec 2024 00:20:32 -0800 Subject: [PATCH 38/43] fix: add nix-index-database nixosModule --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 6ae85ab..51d9d89 100755 --- a/flake.nix +++ b/flake.nix @@ -159,6 +159,7 @@ inputs.home-manager.nixosModules.home-manager inputs.nixos-wsl.nixosModules.default inputs.stylix.nixosModules.stylix + inputs.nix-index-database.nixosModules.nix-index ./modules/default.nix ( { pkgs, ... }: From fbdc38100d05e1c3c8501c680f2adf602411fac0 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 26 Dec 2024 00:24:42 -0800 Subject: [PATCH 39/43] fix: use patched fork of nix-index-database --- flake.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 51d9d89..df03417 100755 --- a/flake.nix +++ b/flake.nix @@ -80,7 +80,7 @@ stylix.url = "github:danth/stylix"; nix-index-database = { - url = "github:nix-community/nix-index-database"; + url = "github:marienz/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -159,7 +159,6 @@ inputs.home-manager.nixosModules.home-manager inputs.nixos-wsl.nixosModules.default inputs.stylix.nixosModules.stylix - inputs.nix-index-database.nixosModules.nix-index ./modules/default.nix ( { pkgs, ... }: From b8e60dcab01c92be2b5d5f9de73178780425db90 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 26 Dec 2024 00:41:37 -0800 Subject: [PATCH 40/43] chore: move overlays --- flake.nix | 1 + overlays/default.nix | 5 ----- reference/hosts/demeter/default.nix | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index df03417..dc8b2db 100755 --- a/flake.nix +++ b/flake.nix @@ -160,6 +160,7 @@ inputs.nixos-wsl.nixosModules.default inputs.stylix.nixosModules.stylix ./modules/default.nix + ./overlays ( { pkgs, ... }: { diff --git a/overlays/default.nix b/overlays/default.nix index 6126118..e9fae22 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,5 +1,4 @@ { - inputs, pkgs, ... }: @@ -12,9 +11,5 @@ in { nixpkgs.overlays = [ (import ../pkgs { inherit pkgs; }) - (self: super: { - zen-browser = inputs.zen-browser.packages.${system}.default; - zen-browser-unwrapped = inputs.zen-browser.packages.${system}.zen-browser-unwrapped; - }) ]; } diff --git a/reference/hosts/demeter/default.nix b/reference/hosts/demeter/default.nix index f0559a6..19941ba 100644 --- a/reference/hosts/demeter/default.nix +++ b/reference/hosts/demeter/default.nix @@ -8,7 +8,6 @@ [ ./configuration.nix self.nixosModules.liminalOS - ../../../overlays { home-manager.users.youwen = { imports = [ ./home.nix ]; From d0c22732fe0b2f87ecd6e5df3e0252623f524db8 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 26 Dec 2024 00:41:53 -0800 Subject: [PATCH 41/43] flake.lock: update --- flake.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 12590d2..bafa0b8 100644 --- a/flake.lock +++ b/flake.lock @@ -573,15 +573,15 @@ ] }, "locked": { - "lastModified": 1735160596, - "narHash": "sha256-zD8ciZm42wi1ijHyS7J0dmBE3QXMA/qBfwW/SEXhiwI=", - "owner": "nix-community", + "lastModified": 1735182763, + "narHash": "sha256-S2zkij+fcLpWOM3IfyThOoypBVe1c0pWW2w9cRBdFio=", + "owner": "marienz", "repo": "nix-index-database", - "rev": "c8470746a9f4d1ab4c7563db7da995595ed64ca2", + "rev": "0a961f691c4da1e7edc0c23afd6e8d6765499ce0", "type": "github" }, "original": { - "owner": "nix-community", + "owner": "marienz", "repo": "nix-index-database", "type": "github" } From 512b0e3aa16bed6970d2ecae636fe45e87227d08 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 26 Dec 2024 00:42:00 -0800 Subject: [PATCH 42/43] feat: add hyprland-qtutils --- .../desktop-environment/hyprland/default.nix | 1 + pkgs/by-name/hyprland-qtutils/default.nix | 49 +++++++++++++++++++ pkgs/default.nix | 1 + 3 files changed, 51 insertions(+) create mode 100644 pkgs/by-name/hyprland-qtutils/default.nix diff --git a/hm/modules/linux/desktop-environment/hyprland/default.nix b/hm/modules/linux/desktop-environment/hyprland/default.nix index 207d31b..6f5fbda 100644 --- a/hm/modules/linux/desktop-environment/hyprland/default.nix +++ b/hm/modules/linux/desktop-environment/hyprland/default.nix @@ -49,6 +49,7 @@ in libsForQt5.qt5ct papirus-icon-theme libsForQt5.qt5ct + hyprland-qtutils ] ++ (lib.optionals (!osConfig.liminalOS.theming.enable) [ pkgs.bibata-cursors diff --git a/pkgs/by-name/hyprland-qtutils/default.nix b/pkgs/by-name/hyprland-qtutils/default.nix new file mode 100644 index 0000000..e9a6d8d --- /dev/null +++ b/pkgs/by-name/hyprland-qtutils/default.nix @@ -0,0 +1,49 @@ +{ + lib, + gcc14Stdenv, + fetchFromGitHub, + cmake, + pkg-config, + hyprutils, + pciutils, + qt6, +}: +let + inherit (lib.strings) makeBinPath; +in +gcc14Stdenv.mkDerivation (finalAttrs: { + pname = "hyprland-qtutils"; + version = "0.1.1"; + + src = fetchFromGitHub { + owner = "hyprwm"; + repo = "hyprland-qtutils"; + tag = "v${finalAttrs.version}"; + hash = "sha256-Zp2cQOo1D7WH7ml5nV7mLyto0l19gTaWnbDb6zty1Qs="; + }; + + nativeBuildInputs = [ + cmake + pkg-config + qt6.wrapQtAppsHook + ]; + + buildInputs = [ + hyprutils + qt6.qtbase + qt6.qtsvg + qt6.qtwayland + ]; + + preFixup = '' + qtWrapperArgs+=(--prefix PATH : "${makeBinPath [ pciutils ]}") + ''; + + meta = { + description = "Hyprland QT/qml utility apps"; + homepage = "https://github.com/hyprwm/hyprland-qtutils"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.fufexan ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/default.nix b/pkgs/default.nix index 8bbf15a..1ff8ae2 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -4,4 +4,5 @@ let in final: prev: { modrinth-app = callPackage ./by-name/modrinth-app { }; + hyprland-qtutils = callPackage ./by-name/hyprland-qtutils { }; } From 3372af8c035c02824e9ba1b924ecf2d7fa7bf1f7 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 26 Dec 2024 00:46:15 -0800 Subject: [PATCH 43/43] feat: add template --- README.md | 12 +- flake.nix | 8 ++ templates/liminalOS/configuration.nix | 106 ++++++++++++++++++ templates/liminalOS/flake.nix | 33 ++++++ .../liminalOS/hardware-configuration.nix | 59 ++++++++++ templates/liminalOS/home.nix | 25 +++++ 6 files changed, 238 insertions(+), 5 deletions(-) create mode 100755 templates/liminalOS/configuration.nix create mode 100644 templates/liminalOS/flake.nix create mode 100644 templates/liminalOS/hardware-configuration.nix create mode 100644 templates/liminalOS/home.nix diff --git a/README.md b/README.md index b33fb55..4ad588a 100755 --- a/README.md +++ b/README.md @@ -6,17 +6,19 @@ based on [NixOS](https://nixos.org/). Time wasted writing Nix code: ![](https://wakatime.com/badge/user/018dc5b8-ba5a-4572-a38a-b526d1b28240/project/c59b3d5e-0c9c-4bd5-a752-e75522ab0cdc.svg) + [![wakatime](https://wakatime.com/badge/user/018dc5b8-ba5a-4572-a38a-b526d1b28240/project/de5e82f8-8a09-42cb-ae45-9c80f2ab5a41.svg)](https://wakatime.com/badge/user/018dc5b8-ba5a-4572-a38a-b526d1b28240/project/de5e82f8-8a09-42cb-ae45-9c80f2ab5a41) -This repository implements a NixOS module that declares the entire liminalOS +This repository exposes a NixOS module that declares the entire liminalOS operating system. It aims to be an easy way to both set up a brand new system with my opinionated configurations, and also inject into an existing NixOS configuration. -A reference implementation of liminalOS on actual working systems is in +Reference implementations of liminalOS on actual working systems is in [./reference](./reference). -liminalOS is currently in a heavily experimental state, and cannot be consumed -directly without much prior work. Development is ongoing to create a fully -self-contained module. +liminalOS is currently in a heavily experimental state, but it is used in +production every day! + +You can try it with `nix flake init -t github:youwen5/liminalOS#liminalOS`, +which will create a sample configuration flake along with corresponding files. Many have written at length about the virtues of NixOS and _declarative configuration_ and _immutability_ and such. I doubt what I have to say is diff --git a/flake.nix b/flake.nix index dc8b2db..16d9dd8 100755 --- a/flake.nix +++ b/flake.nix @@ -189,6 +189,14 @@ ]; }; }; + + templates = rec { + liminalOS = { + path = ./templates/liminalOS; + description = "Barebones configuration of liminalOS"; + }; + default = liminalOS; + }; }; perSystem = { diff --git a/templates/liminalOS/configuration.nix b/templates/liminalOS/configuration.nix new file mode 100755 index 0000000..d48b3bc --- /dev/null +++ b/templates/liminalOS/configuration.nix @@ -0,0 +1,106 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ + pkgs, + inputs, + ... +}: +{ + imports = [ + # Important: you should replace hardware-configuration.nix with your actual + # hardware-configuration.nix generated during NixOS installation, located + # at /etc/nixos/hardware-configuration.nix! If you don't have this file, + # re-run nixos-install to generate it. + ./hardware-configuration.nix + ]; + + networking.hostName = "liminalOS"; # Define your hostname. + + liminalOS = { + # Set this to the absolute path of the location of this configuration flake + # to enable some UX enhanacements + flakeLocation = null; + config.allowUnfree = true; + # Set your default editor to any program. + defaultEditor = pkgs.helix; + # Set to either "laptop" or "desktop" for some adjustments + formFactor = "desktop"; + # Set a wallpaper to whatever you want! You can use a local path as well. + # The colorscheme for the system is automatically generated from this + # wallpaper! + theming = { + wallpaper = pkgs.fetchurl { + url = "https://w.wallhaven.cc/full/l8/wallhaven-l8x1pr.jpg"; + hash = "sha256-Ts8igtDxLsnAnpy+tiGAXVhJWYLMHGOb2fd8lpV+UnM="; + }; + }; + system = { + # Toggle true to enable audio production software, like reaper, and yabridge + 64 bit wine for + # installing Windows-exclusive VSTs! + audio.prod.enable = false; + + networking = { + # Toggle on to allow default vite ports of 5173 and 4173 through the firewall for local testing! + firewallPresets.vite = false; + # Use cloudflare's 1.1.1.1 DNS servers + cloudflareNameservers.enable = true; + }; + graphics.nvidia.enable = true; + }; + extras.gaming = { + # Enable gaming utilities, like Heroic, Lutris, Steam + enable = true; + # Installs Roblox using Sober, as a flatpak. Note that this will enable + # the impure flatpak service that automatically updates flatpaks every + # week upon nixos-rebuild switch + roblox.enable = true; + + utilities.gamemode = { + # enable the gamemoderun binary to maximize gaming performance + enable = true; + # don't forget to update this if you change your username! + gamemodeUsers = [ "default-user" ]; + }; + }; + }; + + # Set up a user + users.users.default-user = { + isNormalUser = true; + description = "Default liminalOS user!"; + extraGroups = [ + "networkmanager" + "wheel" + ]; + shell = pkgs.fish; + }; + + home-manager.users.default-user = { + imports = [ ./home.nix ]; + }; + home-manager.extraSpecialArgs = { inherit inputs; }; + + # Set your time zone + time.timeZone = "America/Los_Angeles"; + + # Bootloader and kernel. + boot = { + loader = { + efi.canTouchEfiVariables = true; + timeout = 15; + systemd-boot = { + enable = true; + }; + }; + kernelPackages = pkgs.linuxPackages_zen; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.05"; # Did you read the comment? +} diff --git a/templates/liminalOS/flake.nix b/templates/liminalOS/flake.nix new file mode 100644 index 0000000..1be6257 --- /dev/null +++ b/templates/liminalOS/flake.nix @@ -0,0 +1,33 @@ +{ + description = "Test standalone liminalOS system"; + + inputs = { + # Follow the nixpkgs in liminalOS, which is verified to build properly before release. + nixpkgs.follows = "liminalOS/nixpkgs"; + liminalOS.url = "github:youwen5/liminalOS/modules-refactor"; + + # Alternatively, pin your own nixpkgs and set liminalOS to follow it, as shown below. + + # nixpkgs.follows = "github:nixos/nixpkgs?ref=nixos-unstable"; + # liminalOS.url = "github:youwen5/liminalOS/modules-refactor"; + # liminalOS.inputs.nixpkgs.follows = "nixpkgs"; + + # Either way, you should ensure that liminalOS shares nixpkgs with your + # system to avoid any weird conflicts. + }; + + outputs = + inputs@{ nixpkgs, liminalOS, ... }: + { + # Execute sudo nixos-rebuild switch --flake .#liminalOS + nixosConfigurations = { + liminalOS = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + liminalOS.nixosModules.default + ./configuration.nix + ]; + }; + }; + }; +} diff --git a/templates/liminalOS/hardware-configuration.nix b/templates/liminalOS/hardware-configuration.nix new file mode 100644 index 0000000..ff26c83 --- /dev/null +++ b/templates/liminalOS/hardware-configuration.nix @@ -0,0 +1,59 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/5a339a7f-8668-42d7-9ecc-d7a8f1d3f7b2"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-362ec972-7c5e-4c9f-ba5d-b8f2ed083509".device = + "/dev/disk/by-uuid/362ec972-7c5e-4c9f-ba5d-b8f2ed083509"; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/27EE-D950"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/670fc084-d593-44b3-aed9-78d95fec71de"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # 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.enp6s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/templates/liminalOS/home.nix b/templates/liminalOS/home.nix new file mode 100644 index 0000000..994852f --- /dev/null +++ b/templates/liminalOS/home.nix @@ -0,0 +1,25 @@ +{ inputs, ... }: +{ + imports = [ + # import the liminalOS home manager module + inputs.liminalOS.homeManagerModules.default + ]; + + home = { + username = "default-user"; + homeDirectory = "/home/default-user"; + }; + + liminalOS = { + # Enable the easyeffects program to easily EQ your headphones and add + # microphone effects + utils.easyeffects.enable = true; + }; + + programs.git = { + userName = "Default User"; + userEmail = "default@localhost"; + }; + + home.stateVersion = "24.05"; +}