cleanup names
This commit is contained in:
@@ -51,7 +51,7 @@ rec {
|
||||
localAddress ? "127.0.0.1",
|
||||
port ? "80",
|
||||
bindMounts ? { },
|
||||
config ? { }
|
||||
config ? { },
|
||||
}:
|
||||
{ lib, ... }:
|
||||
{
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
}:
|
||||
let
|
||||
cfg = config.mjallen.sops;
|
||||
|
||||
user = config.${namespace}.user.name;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
@@ -12,7 +12,7 @@ let
|
||||
wallpaperDir = "/var/lib/wallpapers";
|
||||
|
||||
# Default fallback wallpaper (included in the system)
|
||||
defaultWallpaper = pkgs.runCommand "default-wallpaper" {} ''
|
||||
defaultWallpaper = pkgs.runCommand "default-wallpaper" { } ''
|
||||
mkdir -p $out
|
||||
cp ${pkgs.nixos-artwork.wallpapers.nineish-dark-gray}/share/backgrounds/nixos/nix-wallpaper-nineish-dark-gray.png $out/default.jpg
|
||||
'';
|
||||
@@ -89,7 +89,6 @@ let
|
||||
'';
|
||||
|
||||
# Select the appropriate wallpaper script based on the configuration
|
||||
wallpaper-script = if cfg.wallpaperSource == "nasa" then nasa-wallpaper else bing-wallpaper;
|
||||
|
||||
sddmThemeName = "sddm-astronaut-theme";
|
||||
sddmThemePkg = pkgs.sddm-astronaut.override {
|
||||
@@ -216,7 +215,10 @@ in
|
||||
early-wallpaper-setup = {
|
||||
enable = true;
|
||||
description = "Setup wallpaper early in boot process";
|
||||
wantedBy = [ "multi-user.target" "plymouth-start.service" ];
|
||||
wantedBy = [
|
||||
"multi-user.target"
|
||||
"plymouth-start.service"
|
||||
];
|
||||
before = [ "plymouth-start.service" ];
|
||||
script = ''
|
||||
# Ensure wallpaper directory exists
|
||||
|
||||
@@ -5,7 +5,10 @@ with lib;
|
||||
enable = mkEnableOption "enable hyprland desktop environment";
|
||||
|
||||
wallpaperSource = mkOption {
|
||||
type = types.enum [ "bing" "nasa" ];
|
||||
type = types.enum [
|
||||
"bing"
|
||||
"nasa"
|
||||
];
|
||||
default = "bing";
|
||||
description = "Source for the wallpaper (bing or nasa)";
|
||||
};
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
{ lib, pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
fonts.packages =
|
||||
with pkgs;
|
||||
[
|
||||
fonts.packages = with pkgs; [
|
||||
font-awesome
|
||||
noto-fonts
|
||||
noto-fonts-color-emoji
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ lib, system, pkgs, ... }:
|
||||
{
|
||||
lib,
|
||||
system,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
isArm = "aarch64-linux" == system;
|
||||
in
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, namespace, ... }:
|
||||
with lib;
|
||||
let
|
||||
inherit (lib.${namespace}) mkOpt mkBoolOpt;
|
||||
inherit (lib.${namespace}) mkBoolOpt;
|
||||
in
|
||||
{
|
||||
options.${namespace}.hardware.nvidia = {
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{ config, lib, pkgs, namespace, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.services.home-assistant;
|
||||
@@ -10,6 +16,8 @@ in
|
||||
openFirewall = true;
|
||||
configDir = "/var/lib/homeassistant";
|
||||
configWritable = true; # todo
|
||||
# All components
|
||||
# extraComponents = config.services.home-assistant.package.availableComponents;
|
||||
extraComponents = [
|
||||
"adguard"
|
||||
"apple_tv"
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.services.home-assistant;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.services.home-assistant;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
{
|
||||
nix = {
|
||||
settings = {
|
||||
@@ -32,7 +37,7 @@
|
||||
nixpkgs = {
|
||||
config = {
|
||||
allowUnfree = lib.mkForce true;
|
||||
cudaSupport =lib.mkDefault config.${namespace}.hardware.nvidia.enable;
|
||||
cudaSupport = lib.mkDefault config.${namespace}.hardware.nvidia.enable;
|
||||
allowUnsupportedSystem = true;
|
||||
permittedInsecurePackages = [
|
||||
# ...
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
# inherit (lib.${namespace}) mkModule mkOpt mkBoolOpt enableForSystem;
|
||||
|
||||
@@ -67,7 +67,8 @@ in
|
||||
"guest account" = "nobody";
|
||||
"map to guest" = "bad user";
|
||||
};
|
||||
} // sambaShares;
|
||||
}
|
||||
// sambaShares;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{ config, lib, system, namespace, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
system,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
defaultSops = (lib.snowfall.fs.get-file "secrets/secrets.yaml");
|
||||
isx86 = system == "x86_64-linux";
|
||||
|
||||
@@ -5,13 +5,16 @@ let
|
||||
in
|
||||
{
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
environment.systemPackages =
|
||||
with pkgs;
|
||||
[
|
||||
nil
|
||||
qemu
|
||||
udisks2
|
||||
unzip
|
||||
] ++
|
||||
(if isArm then
|
||||
]
|
||||
++ (
|
||||
if isArm then
|
||||
[ ]
|
||||
else
|
||||
[
|
||||
|
||||
@@ -52,7 +52,9 @@ in
|
||||
|
||||
hashedPassword = mkOpt (nullOr str) null "Hashed password for the user.";
|
||||
|
||||
hashedPasswordFile = mkOpt (nullOr path) defaultPasswordFile "Path to the password file for this user account";
|
||||
hashedPasswordFile =
|
||||
mkOpt (nullOr path) defaultPasswordFile
|
||||
"Path to the password file for this user account";
|
||||
|
||||
mutableUsers = mkBoolOpt false "Whether users are mutable (can be modified after creation).";
|
||||
};
|
||||
@@ -104,20 +106,29 @@ in
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = (cfg.password != null) || (cfg.hashedPassword != null) || (cfg.hashedPasswordFile != null);
|
||||
assertion =
|
||||
(cfg.password != null) || (cfg.hashedPassword != null) || (cfg.hashedPasswordFile != null);
|
||||
message = "User '${cfg.name}' requires at least one password method (password, hashedPassword, or hashedPasswordFile).";
|
||||
}
|
||||
{
|
||||
assertion =
|
||||
let
|
||||
passwordMethods = lib.count (x: x != null) [ cfg.password cfg.hashedPassword cfg.hashedPasswordFile ];
|
||||
passwordMethods = lib.count (x: x != null) [
|
||||
cfg.password
|
||||
cfg.hashedPassword
|
||||
cfg.hashedPasswordFile
|
||||
];
|
||||
in
|
||||
passwordMethods <= 1;
|
||||
message = "User '${cfg.name}' can only use one password method at a time. Found multiple: ${lib.concatStringsSep ", " (lib.filter (x: x != null) [
|
||||
message = "User '${cfg.name}' can only use one password method at a time. Found multiple: ${
|
||||
lib.concatStringsSep ", " (
|
||||
lib.filter (x: x != null) [
|
||||
(if cfg.password != null then "password" else null)
|
||||
(if cfg.hashedPassword != null then "hashedPassword" else null)
|
||||
(if cfg.hashedPasswordFile != null then "hashedPasswordFile" else null)
|
||||
])}";
|
||||
]
|
||||
)
|
||||
}";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
2
qemu.nix
2
qemu.nix
@@ -1,4 +1,4 @@
|
||||
with import <nixpkgs> {};
|
||||
with import <nixpkgs> { };
|
||||
|
||||
writeShellApplication {
|
||||
name = "test-image";
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||
|
||||
{
|
||||
config,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||
|
||||
{
|
||||
config,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
user = config.${namespace}.user.name;
|
||||
desktopSopsFile = (lib.snowfall.fs.get-file "secrets/desktop-secrets.yaml");
|
||||
79
systems/x86_64-linux/nuc-nixos/hardware-configuration.nix
Normal file
79
systems/x86_64-linux/nuc-nixos/hardware-configuration.nix
Normal file
@@ -0,0 +1,79 @@
|
||||
# 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,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"nvme"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"uas"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = lib.mkForce {
|
||||
device = "none";
|
||||
fsType = "tmpfs";
|
||||
options = [ "mode=755" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" = lib.mkForce {
|
||||
device = "UUID=0FCB-EC63"; # "/dev/disk/by-partlabel/disk-main-ESP";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0022"
|
||||
"dmask=0022"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/var/log" = lib.mkForce {
|
||||
device = "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
|
||||
fsType = "bcachefs";
|
||||
options = [ "X-mount.subdir=log" ];
|
||||
};
|
||||
|
||||
fileSystems."/root" = lib.mkForce {
|
||||
device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
|
||||
fsType = "bcachefs";
|
||||
options = [ "X-mount.subdir=root" ];
|
||||
};
|
||||
|
||||
fileSystems."/etc" = lib.mkForce {
|
||||
device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
|
||||
fsType = "bcachefs";
|
||||
options = [ "X-mount.subdir=etc" ];
|
||||
};
|
||||
|
||||
fileSystems."/nix" = lib.mkForce {
|
||||
device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
|
||||
fsType = "bcachefs";
|
||||
options = [
|
||||
"X-mount.subdir=nix"
|
||||
"verbose"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/home" = lib.mkForce {
|
||||
device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
|
||||
fsType = "bcachefs";
|
||||
options = [ "X-mount.subdir=home" ];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -1,8 +1,4 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
defaultSops = (lib.snowfall.fs.get-file "secrets/nuc-secrets.yaml");
|
||||
sharedSops = (lib.snowfall.fs.get-file "secrets/secrets.yaml");
|
||||
in
|
||||
{
|
||||
# Permission modes are in octal representation (same as chmod),
|
||||
# the digits represent: user|group|others
|
||||
@@ -1,63 +0,0 @@
|
||||
# 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" "nvme" "ahci" "usbhid" "uas" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = lib.mkForce
|
||||
{ device = "none";
|
||||
fsType = "tmpfs";
|
||||
options = [ "mode=755" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" = lib.mkForce
|
||||
{ device = "UUID=0FCB-EC63"; # "/dev/disk/by-partlabel/disk-main-ESP";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
fileSystems."/var/log" = lib.mkForce
|
||||
{ device = "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
|
||||
fsType = "bcachefs";
|
||||
options = [ "X-mount.subdir=log" ];
|
||||
};
|
||||
|
||||
fileSystems."/root" = lib.mkForce
|
||||
{ device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
|
||||
fsType = "bcachefs";
|
||||
options = [ "X-mount.subdir=root" ];
|
||||
};
|
||||
|
||||
fileSystems."/etc" = lib.mkForce
|
||||
{ device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
|
||||
fsType = "bcachefs";
|
||||
options = [ "X-mount.subdir=etc" ];
|
||||
};
|
||||
|
||||
fileSystems."/nix" = lib.mkForce
|
||||
{ device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
|
||||
fsType = "bcachefs";
|
||||
options = [ "X-mount.subdir=nix" "verbose" ];
|
||||
};
|
||||
|
||||
fileSystems."/home" = lib.mkForce
|
||||
{ device = lib.mkDefault "UUID=88d9c058-757d-c06e-0fb7-a612f2db8a7a"; # "/dev/disk/by-partlabel/disk-main-root";
|
||||
fsType = "bcachefs";
|
||||
options = [ "X-mount.subdir=home" ];
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
Reference in New Issue
Block a user