beginning a lot of reorganizing stuff
This commit is contained in:
4
base/base-gui/default.nix
Normal file
4
base/base-gui/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ./services.nix ];
|
||||
}
|
||||
15
base/base-gui/services.nix
Normal file
15
base/base-gui/services.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
services = {
|
||||
# configure pipewire
|
||||
pipewire = {
|
||||
enable = lib.mkDefault true;
|
||||
alsa.enable = lib.mkDefault true;
|
||||
alsa.support32Bit = lib.mkDefault true;
|
||||
pulse.enable = lib.mkDefault true;
|
||||
};
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
printing.enable = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
14
base/base-nogui/boot.nix
Normal file
14
base/base-nogui/boot.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
boot = {
|
||||
# Enable AppImage
|
||||
binfmt.registrations.appimage = {
|
||||
wrapInterpreterInShell = lib.mkDefault false;
|
||||
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
|
||||
recognitionType = "magic";
|
||||
offset = 0;
|
||||
mask = "\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\xff\\xff\\xff";
|
||||
magicOrExtension = "\\x7fELF....AI\\x02";
|
||||
};
|
||||
};
|
||||
}
|
||||
45
base/base-nogui/default.nix
Normal file
45
base/base-nogui/default.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
timezone = "America/Chicago";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
./environment.nix
|
||||
./nix-settings.nix
|
||||
./security.nix
|
||||
./services.nix
|
||||
../../share
|
||||
];
|
||||
|
||||
# Hardware configs
|
||||
hardware = {
|
||||
# Bluetooth
|
||||
bluetooth.enable = lib.mkDefault true;
|
||||
|
||||
# Enable all firmware
|
||||
enableAllFirmware = lib.mkForce true;
|
||||
};
|
||||
|
||||
# Time config
|
||||
time = {
|
||||
# Set your time zone.
|
||||
timeZone = timezone;
|
||||
};
|
||||
|
||||
programs = {
|
||||
zsh.enable = lib.mkDefault true;
|
||||
gnupg.agent = {
|
||||
enable = lib.mkDefault true;
|
||||
enableSSHSupport = lib.mkDefault true;
|
||||
};
|
||||
command-not-found.enable = lib.mkForce false;
|
||||
nix-index = {
|
||||
enable = true;
|
||||
enableBashIntegration = false;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
}
|
||||
12
base/base-nogui/environment.nix
Normal file
12
base/base-nogui/environment.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
uutils-coreutils
|
||||
uutils-diffutils
|
||||
uutils-findutils
|
||||
coreutils
|
||||
nixd
|
||||
];
|
||||
};
|
||||
}
|
||||
41
base/base-nogui/nix-settings.nix
Normal file
41
base/base-nogui/nix-settings.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{ lib, outputs, ... }:
|
||||
{
|
||||
nix = {
|
||||
settings = {
|
||||
substituters = [
|
||||
"https://nix-community.cachix.org"
|
||||
"https://cache.nixos.org/"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
warn-dirty = lib.mkForce false;
|
||||
experimental-features = lib.mkForce [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
trusted-users = [ "@wheel" ];
|
||||
};
|
||||
|
||||
# Garbage collect automatically every week
|
||||
gc.automatic = lib.mkDefault true;
|
||||
gc.options = lib.mkDefault "--delete-older-than 30d";
|
||||
|
||||
optimise.automatic = lib.mkDefault true;
|
||||
};
|
||||
|
||||
# Nixpkgs configuration
|
||||
nixpkgs = {
|
||||
# add unstable and stable overlays
|
||||
overlays = [
|
||||
outputs.overlays.nixpkgs-unstable
|
||||
outputs.overlays.nixpkgs-stable
|
||||
];
|
||||
config = {
|
||||
allowUnfree = lib.mkForce true;
|
||||
permittedInsecurePackages = [
|
||||
# ...
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
31
base/base-nogui/security.nix
Normal file
31
base/base-nogui/security.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
security = {
|
||||
rtkit.enable = lib.mkDefault true;
|
||||
|
||||
# configure sudo
|
||||
sudo.enable = lib.mkDefault false;
|
||||
sudo-rs = {
|
||||
enable = lib.mkDefault true;
|
||||
extraRules = [
|
||||
{
|
||||
commands = [
|
||||
{
|
||||
command = "${pkgs.systemd}/bin/systemctl suspend";
|
||||
options = [ "NOPASSWD" ];
|
||||
}
|
||||
{
|
||||
command = "${pkgs.systemd}/bin/reboot";
|
||||
options = [ "NOPASSWD" ];
|
||||
}
|
||||
{
|
||||
command = "${pkgs.systemd}/bin/poweroff";
|
||||
options = [ "NOPASSWD" ];
|
||||
}
|
||||
];
|
||||
groups = [ "wheel" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
25
base/base-nogui/services.nix
Normal file
25
base/base-nogui/services.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
services = {
|
||||
openssh.enable = lib.mkDefault true;
|
||||
|
||||
# Enable firmware updates
|
||||
fwupd.enable = lib.mkForce true;
|
||||
|
||||
fstrim.enable = lib.mkDefault true;
|
||||
|
||||
pcscd.enable = lib.mkDefault true;
|
||||
|
||||
# Enable Avahi for .local hostname resolution
|
||||
avahi = {
|
||||
enable = lib.mkDefault true;
|
||||
nssmdns4 = lib.mkDefault true; # For modern systems, use nssmdns4 instead of nssmdns
|
||||
publish = {
|
||||
enable = lib.mkDefault true;
|
||||
addresses = lib.mkDefault true;
|
||||
domain = lib.mkDefault true;
|
||||
workstation = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
27
base/default.nix
Normal file
27
base/default.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
# { lib, config, ... }:
|
||||
|
||||
# let
|
||||
# cfg = config.base;
|
||||
|
||||
# cosmicPath =
|
||||
# if cfg.desktopEnvironments.cosmic.enableSpecialisation then
|
||||
# ../../modules/desktop-environments/cosmic/specialisation.nix
|
||||
# else
|
||||
# ../../modules/desktop-environments/cosmic/default.nix;
|
||||
|
||||
# hyprlandPath =
|
||||
# if cfg.desktopEnvironments.hyprland.enableSpecialisation then
|
||||
# ../../modules/desktop-environments/hyprland/specialisation.nix
|
||||
# else
|
||||
# ../../modules/desktop-environments/hyprland/default.nix;
|
||||
|
||||
# extraImports = lib.optionals cfg.enable (
|
||||
# [ ./base-nogui ]
|
||||
# ++ lib.optional cfg.baseGui.enable ./base-gui
|
||||
# ++ lib.optional cfg.desktopEnvironments.cosmic.enable cosmicPath
|
||||
# ++ lib.optional cfg.desktopEnvironments.hyprland.enable hyprlandPath
|
||||
# );
|
||||
# in
|
||||
# {
|
||||
# imports = [ ./options.nix ] ++ extraImports;
|
||||
# }
|
||||
35
base/options.nix
Normal file
35
base/options.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.base = {
|
||||
enable = mkEnableOption "base config";
|
||||
|
||||
baseGui.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
desktopEnvironments = {
|
||||
cosmic = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
enableSpecialisation = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
hyprland = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
enableSpecialisation = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user