This commit is contained in:
twoneis 2024-08-02 23:49:06 +02:00
parent 16fa4956e5
commit a5b5ea7f59
28 changed files with 164 additions and 123 deletions

View file

@ -1,12 +1,11 @@
{ ... }: {
full = true;
conf = {
apps.enable = true;
niri.enable = true;
containers.enable = true;
withNiri = true;
withContainers = true;
hwmonPath = "/sys/class/hwmon/hwmon1/temp1_input";
stateVersion = "24.05";
hmStateVersion = "24.11";
hwmonPath = "/sys/class/hwmon/hwmon1/temp1_input";
stateVersion = "24.05";
hmStateVersion = "24.11";
};
}

View file

@ -1,13 +1,12 @@
{ ... }: {
full = true;
conf = {
apps.enable = true;
niri.enable = true;
games.enable = true;
secureboot.enable = true;
withNiri = true;
withGames = true;
withSecureBoot = true;
hwmonPath = "/sys/class/hwmon/hwmon1/temp1_input";
stateVersion = "24.05";
hmStateVersion = "24.11";
hwmonPath = "/sys/class/hwmon/hwmon1/temp1_input";
stateVersion = "24.05";
hmStateVersion = "24.11";
};
}

View file

@ -1,4 +1,6 @@
{ ... }: {
stateVersion = "24.05";
hmStateVersion = "24.11";
conf = {
stateVersion = "24.05";
hmStateVersion = "24.11";
};
}

16
disks.nix Normal file
View file

@ -0,0 +1,16 @@
{ lib, ... }: let
inherit (lib) mkOption;
inherit (lib.types) attrsOf str;
in {
options = {
disks = mkOption {
type = attrsOf str;
default = { };
example = {
boot = "4672-C1A9";
crypt = "747ae319-f189-44f5-9737-a42672e2c02d";
root = "04255623-c061-4cf0-89fa-b3d8eb239d59";
};
};
};
}

View file

@ -1,7 +1,7 @@
{ lib, ... }: let
inherit (lib) mkOption;
inherit (lib.types) attrsOf str;
in {
in{
options = {
keys = mkOption {
type = attrsOf str;

View file

@ -1,4 +1,7 @@
{ lib, config, pkgs, ... }: {
{ lib, config, pkgs, ... }: let
inherit (lib) mkIf;
inherit (config) conf;
in {
imports = [
./media.nix
./notes.nix
@ -6,7 +9,7 @@
./themes.nix
];
config = lib.mkIf config.full {
config = mkIf conf.apps.enable {
# Audio
security.rtkit.enable = true;
@ -30,7 +33,7 @@
};
};
home-manager.users.${config.username}.home.packages = [ pkgs.overskride ];
home-manager.users.${conf.username}.home.packages = [ pkgs.overskride ];
services.blueman.enable = true;
};

View file

@ -1,6 +1,9 @@
{ inputs, lib, config, pkgs, ... }: lib.mkIf config.full {
{ inputs, lib, config, pkgs, ... }: let
inherit (lib) mkIf;
inherit (config) conf;
in mkIf conf.apps.enable {
nixpkgs.overlays = [ inputs.nur.overlay ];
home-manager.users.${config.username} = {
home-manager.users.${conf.username} = {
programs.firefox = {
enable = true;
profiles = {

17
modules/apps/media.nix Normal file
View file

@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }: let
inherit (lib) mkIf;
inherit (config) conf;
in mkIf conf.apps.enable {
home-manager.users.${conf.username} = {
home.packages = with pkgs; [
loupe
spotify
amberol
];
programs.mpv = {
enable = true;
};
};
}

View file

@ -1,5 +1,8 @@
{ lib, config, ... }: lib.mkIf config.full {
home-manager.users.${config.username} = {
{ lib, config, ... }: let
inherit (lib) mkIf;
inherit (config) conf;
in mkIf conf.apps.enable {
home-manager.users.${conf.username} = {
home.packages = [
];

View file

@ -1,15 +1,18 @@
{ lib, config, pkgs, ... }: {
{ lib, config, pkgs, ... }: let
inherit (lib) mkIf;
inherit (config) conf;
in {
imports = [
./firefox.nix
];
config = lib.mkIf config.full {
config = mkIf conf.apps.enable {
services = {
# Needed for some features in nautilus such as auto-mounting and trash
gvfs.enable = true;
};
home-manager.users.${config.username} = {
home-manager.users.${conf.username} = {
home.packages = with pkgs; [
signal-desktop
vesktop

View file

@ -1,5 +1,8 @@
{ lib, config, pkgs, ... }: lib.mkIf config.full {
home-manager.users.${config.username} = {
{ lib, config, pkgs, ... }: let
inherit (lib) mkIf;
inherit (config) conf;
in mkIf conf.apps.enable {
home-manager.users.${conf.username} = {
home.packages = with pkgs; [
adwaita-icon-theme
adwaita-qt

View file

@ -1,4 +1,7 @@
{ lib, config, pkgs, ... }: lib.mkIf config.withContainers {
{ lib, config, pkgs, ... }: let
inherit (lib) mkIf;
inherit (config) conf;
in mkIf conf.containers.enable {
virtualisation.podman = {
enable = true;
dockerCompat = true;

View file

@ -1,5 +1,8 @@
{ lib, config, ... }: {
{ config, ... }: let
inherit (config) conf;
in {
imports = [
./apps
./containers
./fonts
./games
@ -10,7 +13,6 @@
./niri
./nix
./secureboot
./user
./utils
./vm
];
@ -29,11 +31,11 @@
};
};
users.users.${config.username}= {
users.users.${conf.username}= {
isNormalUser = true;
description = config.username;
description = conf.username;
extraGroups = [ "networkmanager" "wheel" ];
};
system.stateVersion = config.stateVersion;
system.stateVersion = conf.stateVersion;
}

View file

@ -1,5 +1,6 @@
{ lib, config, pkgs, ... }: let
inherit (lib) mkIf mkMerge;
inherit (config) conf;
holo-script = pkgs.writeShellApplication {
name = "holo-script";
runtimeInputs = [ pkgs.steam pkgs.gamescope ];
@ -12,9 +13,9 @@
desktopName = "Holo";
exec = "${holo-script}/bin/holo-script";
};
in mkIf config.withGames (mkMerge [
(mkIf config.withImpermanence {
environment.persistence."/persist".users.${config.username}= {
in mkIf conf.games.enable (mkMerge [
(mkIf conf.impermanence.enable {
environment.persistence."/persist".users.${conf.username}= {
directories = [
"Games"
".steam"
@ -26,7 +27,7 @@ in mkIf config.withGames (mkMerge [
programs.gamescope.enable = true;
programs.gamemode.enable = true;
home-manager.users.${config.username} = {
home-manager.users.${conf.username} = {
home.packages = [
pkgs.prismlauncher
holo

View file

@ -1,14 +1,16 @@
{ config, ... }: {
{ config, ... }: let
inherit (config) conf;
in{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${config.username} = {
users.${conf.username} = {
home = {
username = "twoneis";
homeDirectory = "/home/${config.username}";
homeDirectory = "/home/${conf.username}";
stateVersion = config.hmStateVersion;
stateVersion = conf.hmStateVersion;
};
programs.home-manager.enable = true;

View file

@ -1,4 +1,7 @@
{ lib, config, ... }: lib.mkIf config.withImpermanence {
{ lib, config, ... }: let
inherit (lib) mkIf;
inherit (config) conf;
in mkIf conf.impermanence.enable {
environment.persistence."/persist" = {
enable = true;
directories = [
@ -14,7 +17,7 @@
"/etc/shadow"
];
users.${config.username}= {
users.${conf.username}= {
directories = [
"Documents"
"Pictures"

View file

@ -1,5 +1,7 @@
{ config, pkgs, ... }: {
home-manager.users.${config.username}.home.packages = [ pkgs.networkmanagerapplet ];
{ config, pkgs, ... }: let
inherit (config) conf;
in{
home-manager.users.${conf.username}.home.packages = [ pkgs.networkmanagerapplet ];
networking = {
networkmanager = {
enable = true;

View file

@ -1,13 +1,13 @@
{ inputs, lib, config, pkgs, ... }: let
inherit (lib) mkIf;
inherit (config) withNiri username;
inherit (config) conf;
in {
imports = [
./xwl-satellite.service.nix
];
config = mkIf withNiri {
nixpkgs.overlays = mkIf config.withNiri [
config = mkIf conf.niri.enable {
nixpkgs.overlays = [
inputs.niri.overlays.niri
];
@ -26,7 +26,7 @@ in {
lidSwitch = "suspend";
};
home-manager.users.${username} = {
home-manager.users.${conf.username} = {
home.packages = with pkgs; [
brightnessctl
swaybg

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: let
inherit (lib) mkIf;
inherit (config) withNiri;
in mkIf withNiri {
inherit (config) conf;
in mkIf conf.niri.enable {
environment.systemPackages = with pkgs; [ xwayland-satellite xwayland ];
systemd.user.services.xwayland-satellite = {
description = "Xwayland outside your Wayland";

View file

@ -1,6 +1,7 @@
{ lib, config, pkgs, ... }: let
inherit (lib) mkIf mkForce;
in mkIf config.withSecureBoot {
inherit (config) conf;
in mkIf conf.secureboot.enable {
environment.systemPackages = [ pkgs.sbctl ];
boot.loader.systemd-boot.enable = mkForce false;

View file

@ -1,14 +0,0 @@
{ config, lib, pkgs, ... }: lib.mkIf config.full {
home-manager.users.${config.username} = {
home.packages = with pkgs; [
loupe
spotify
amberol
];
programs.mpv = {
enable = true;
};
};
}

View file

@ -1,8 +1,10 @@
{ config, pkgs, ... }: {
{ config, pkgs, ... }: let
inherit (config) conf;
in {
programs.fish.enable = true;
users.defaultUserShell = pkgs.fish;
home-manager.users.${config.username} = {
home-manager.users.${conf.username} = {
home.packages = with pkgs; [
man-pages
man-pages-posix

View file

@ -1,5 +1,8 @@
{ lib, config, ... }: lib.mkIf config.withVM {
{ lib, config, ... }: let
inherit (lib) mkIf;
inherit (config) conf;
in mkIf conf.vm.enable {
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
users.users.${config.username}.extraGroups = [ "libvirtd" ];
users.users.${conf.username}.extraGroups = [ "libvirtd" ];
}

View file

@ -1,53 +1,40 @@
{ lib, ... }: {
options = let
inherit (lib) mkOption mkEnableOption;
inherit (lib.types) nullOr attrsOf str;
in {
full = mkEnableOption "Enable complete configuration for end-user machine";
{ lib, ... }: let
inherit (lib) mkOption mkEnableOption;
inherit (lib.types) nullOr str;
in {
options = {
conf = {
apps.enable = mkEnableOption "Enable complete configuration for end-user machine";
niri.enable = mkEnableOption "Enable niri compositor";
vm.enable = lib.mkEnableOption "Enable VM related configuration";
containers.enable = mkEnableOption "Enable container support";
games.enable = mkEnableOption "Enable games";
impermanence.enable = mkEnableOption "Use impermanence module";
secureboot.enable = mkEnableOption "Enable secure boot utilities (manual key-enrolling required)";
withNiri = mkEnableOption "Enable niri compositor";
withVM = lib.mkEnableOption "Enable VM related configuration";
withContainers = mkEnableOption "Enable container support";
withGames = mkEnableOption "Enable games";
withImpermanence = mkEnableOption "Use impermanence module";
withSecureBoot = mkEnableOption "Enable secure boot utilities (manual key-enrolling required)";
disks = mkOption {
type = attrsOf str;
default = { };
example = {
boot = "4672-C1A9";
crypt = "747ae319-f189-44f5-9737-a42672e2c02d";
root = "04255623-c061-4cf0-89fa-b3d8eb239d59";
username = mkOption {
type = str;
default = "twoneis";
example = "anna";
};
};
username = mkOption {
type = str;
default = "twoneis";
example = "anna";
};
hwmonPath = mkOption {
type = nullOr str;
default = null;
example = "/sys/class/hwmon/hwmon1/temp1_input";
};
hwmonPath = mkOption {
type = nullOr str;
default = null;
example = "/sys/class/hwmon/hwmon1/temp1_input";
};
stateVersion = mkOption {
type = nullOr str;
default = null;
example = "24.05";
};
stateVersion = mkOption {
type = nullOr str;
default = null;
example = "24.05";
};
hmStateVersion = mkOption {
type = nullOr str;
default = null;
example = "24.11";
hmStateVersion = mkOption {
type = nullOr str;
default = null;
example = "24.11";
};
};
};
}

View file

@ -1,9 +1,10 @@
{ nixpkgs, lix, home-manager, nixos-hardware, niri, impermanence, lanzaboote, ... }@inputs: let
modules = [
./modules
./options.nix
./colors.nix
./disks.nix
./keys.nix
./options.nix
niri.nixosModules.niri
home-manager.nixosModules.home-manager
lix.nixosModules.default