fix: reconfigure modules to build successfully on demeter

This commit is contained in:
Youwen Wu 2024-12-23 04:29:01 -08:00
parent ce89f8149e
commit 180741ec71
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
11 changed files with 54 additions and 63 deletions

View file

@ -14,6 +14,28 @@
./hardware-configuration.nix ./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. # Bootloader.
boot.loader = { boot.loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;

View file

@ -6,18 +6,7 @@
imports = imports =
[ [
./configuration.nix ./configuration.nix
../../modules/linux/gaming ../../modules/linux
../../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
../../overlays ../../overlays
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;

View file

@ -12,13 +12,6 @@ in
./linux ./linux
]; ];
options.liminalOS = { 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 { darwin.enable = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = false; default = false;

View file

@ -5,7 +5,7 @@ in
{ {
options.liminalOS.system.audio.enable = lib.mkOption { options.liminalOS.system.audio.enable = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = config.liminalOS.linux.enable; default = config.liminalOS.enable;
description = '' description = ''
Whether to set up PipeWire and default audio utilities. Whether to set up PipeWire and default audio utilities.
''; '';

View file

@ -46,8 +46,8 @@ in
''; '';
}; };
flakeLocation = lib.mkOption { flakeLocation = lib.mkOption {
type = lib.types.str; type = lib.types.nullOr lib.types.path;
default = ""; default = null;
description = '' description = ''
Absolute filepath location of the NixOS system configuration flake. Absolute filepath location of the NixOS system configuration flake.
''; '';

View file

@ -4,16 +4,23 @@
./audio ./audio
./audio-prod ./audio-prod
./core ./core
./desktop-portal ./desktop-environment
./distrobox ./distrobox
./flatpak ./flatpak
./fonts
./gaming ./gaming
./greeter ./greeter
./misc
./networking ./networking
./stylix ./stylix
./wine ./wine
./wsl ./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.
'';
};
} }

View file

@ -9,14 +9,14 @@
... ...
}: }:
let let
cfg = config.liminalOS.programs.flatpaks; cfg = config.liminalOS.programs.flatpak;
in in
{ {
imports = [ imports = [
inputs.${cfg.moduleName}.nixosModules.nix-flatpak inputs.nix-flatpak.nixosModules.nix-flatpak
]; ];
options.liminalOS.programs.flatpaks = { options.liminalOS.programs.flatpak = {
enable = lib.mkOption { enable = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = false; default = false;

View file

@ -15,7 +15,7 @@ in
gamemode = { gamemode = {
enable = lib.mkEnableOption "gamemode"; enable = lib.mkEnableOption "gamemode";
gamemodeUsers = lib.mkOption { gamemodeUsers = lib.mkOption {
type = lib.types.listOf lib.types.string; type = lib.types.listOf lib.types.str;
default = [ ]; default = [ ];
description = '' description = ''
List of users to add to the gamemode group. Gamemode will likely not work unless you add your user to the group! 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 mangojuice
]; ];
liminalOS.programs.flatpaks.enable = true; liminalOS.programs.flatpak.enable = true;
services.flatpak.packages = lib.mkIf cfg.roblox.enable [ services.flatpak.packages = lib.mkIf cfg.roblox.enable [
{ {
@ -82,7 +82,7 @@ in
}; };
users.users = forAllGamemodeUsers (username: { users.users = forAllGamemodeUsers (username: {
${username}.extraGroups = [ "gamemode" ]; extraGroups = [ "gamemode" ];
}); });
services.logmein-hamachi.enable = cfg.utilities.hamachi.enable; services.logmein-hamachi.enable = cfg.utilities.hamachi.enable;

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
cfg = config.liminalOS.system.printing; cfg = config.liminalOS.system;
inherit (lib) mkIf; inherit (lib) mkIf;
in in
{ {
@ -17,7 +17,13 @@ in
Whether to set up default options for printing and printer discover on UNIX. 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"; 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; enable = true;
dockerCompat = true; dockerCompat = true;
}; };
environment.systemPackages = cfg.distrobox.enable [ pkgs.distrobox ]; environment.systemPackages = mkIf cfg.distrobox.enable [ pkgs.distrobox ];
}; };
} }

View file

@ -11,13 +11,6 @@ in
{ {
options.liminalOS.theming = { options.liminalOS.theming = {
enable = lib.mkEnableOption "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 = [ imports = [
@ -58,11 +51,5 @@ in
size = 26; 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.'';
}
];
}; };
} }

View file

@ -9,18 +9,11 @@ let
in in
{ {
imports = [ imports = [
inputs.${cfg.wslName}.nixosModules.default inputs.nixos-wsl.nixosModules.default
]; ];
options = { options.liminalOS.wsl = {
enable = lib.mkEnableOption "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 { config.wsl = lib.mkIf cfg.enable {
@ -28,10 +21,4 @@ in
defaultUser = config.liminalOS.username; defaultUser = config.liminalOS.username;
useWindowsDriver = true; 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.'';
}
];
} }