refactor: organizing some imports
This commit is contained in:
parent
c4f7a64329
commit
db319ed5af
8 changed files with 184 additions and 95 deletions
|
|
@ -1,5 +1,9 @@
|
||||||
{lib, ...}: {
|
{lib, ...}: {
|
||||||
imports = [./thunar.nix];
|
imports = [
|
||||||
|
./thunar.nix
|
||||||
|
./steam.nix
|
||||||
|
];
|
||||||
|
|
||||||
thunar.enable = lib.mkDefault true;
|
thunar.enable = lib.mkDefault true;
|
||||||
|
steam.enable = lib.mkDefault false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,11 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
options = {
|
||||||
|
steam.enable = lib.mkEnableOption "Enables steam";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.steam.enable {
|
||||||
hardware.opengl.driSupport32Bit = true;
|
hardware.opengl.driSupport32Bit = true;
|
||||||
|
|
||||||
nixpkgs.config.packageOverrides = pkgs: {
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
|
|
@ -41,7 +46,6 @@
|
||||||
WINE_FULLSCREEN_FSR = "1";
|
WINE_FULLSCREEN_FSR = "1";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [protonup];
|
||||||
protonup
|
};
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,21 @@
|
||||||
{...}: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
options = {
|
||||||
|
bluetooth.enable = lib.mkEnableOption "Enables Bluetooth";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.bluetooth.enable {
|
||||||
services.blueman.enable = true;
|
services.blueman.enable = true;
|
||||||
hardware.bluetooth = {
|
hardware.bluetooth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
powerOnBoot = true;
|
powerOnBoot = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.upower = {enable = true;};
|
services.upower = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
13
common/nixos/default.nix
Normal file
13
common/nixos/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{lib, ...}: {
|
||||||
|
imports = [
|
||||||
|
./common.nix
|
||||||
|
./laptop.nix
|
||||||
|
./nfs.nix
|
||||||
|
./restic.nix
|
||||||
|
./ssh/default.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
laptop.enable = lib.mkDefault false;
|
||||||
|
nfs.enable = lib.mkDefault false;
|
||||||
|
restic.enable = lib.mkDefault true;
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,20 @@
|
||||||
{...}: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [./bluetooth.nix];
|
imports = [./bluetooth.nix];
|
||||||
|
options = {
|
||||||
|
laptop.enable = lib.mkEnableOption "Enables Laptop options";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.laptop.enable {
|
||||||
# enable's backlight switching
|
# enable's backlight switching
|
||||||
programs.light.enable = true;
|
programs.light.enable = true;
|
||||||
|
|
||||||
# use TLP for power management
|
# use TLP for power management
|
||||||
services.tlp.enable = true;
|
services.tlp.enable = true;
|
||||||
|
|
||||||
|
bluetooth.enable = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,68 @@
|
||||||
{...}: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
options = {
|
||||||
|
nfs.enable = lib.mkEnableOption "Enables NFS and sets up mounts";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.nfs.enable {
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/media" = {
|
"/media" = {
|
||||||
device = "192.168.10.2:/mnt/tank/media";
|
device = "192.168.10.2:/mnt/tank/media";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = ["x-systemd.automount" "noauto" "x-systemd.after=network-online.target" "x-systemd.mount-timeout=90"];
|
options = [
|
||||||
|
"x-systemd.automount"
|
||||||
|
"noauto"
|
||||||
|
"x-systemd.after=network-online.target"
|
||||||
|
"x-systemd.mount-timeout=90"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
"/books" = {
|
"/books" = {
|
||||||
device = "192.168.10.2:/mnt/tank/books";
|
device = "192.168.10.2:/mnt/tank/books";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = ["x-systemd.automount" "noauto" "x-systemd.after=network-online.target" "x-systemd.mount-timeout=90"];
|
options = [
|
||||||
|
"x-systemd.automount"
|
||||||
|
"noauto"
|
||||||
|
"x-systemd.after=network-online.target"
|
||||||
|
"x-systemd.mount-timeout=90"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
"/music" = {
|
"/music" = {
|
||||||
device = "192.168.10.2:/mnt/tank/music";
|
device = "192.168.10.2:/mnt/tank/music";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = ["x-systemd.automount" "noauto" "x-systemd.after=network-online.target" "x-systemd.mount-timeout=90"];
|
options = [
|
||||||
|
"x-systemd.automount"
|
||||||
|
"noauto"
|
||||||
|
"x-systemd.after=network-online.target"
|
||||||
|
"x-systemd.mount-timeout=90"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
"/projects" = {
|
"/projects" = {
|
||||||
device = "192.168.10.2:/mnt/tank/projects";
|
device = "192.168.10.2:/mnt/tank/projects";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = ["x-systemd.automount" "noauto" "x-systemd.after=network-online.target" "x-systemd.mount-timeout=90"];
|
options = [
|
||||||
|
"x-systemd.automount"
|
||||||
|
"noauto"
|
||||||
|
"x-systemd.after=network-online.target"
|
||||||
|
"x-systemd.mount-timeout=90"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
"/backups" = {
|
"/backups" = {
|
||||||
device = "192.168.10.2:/mnt/tank/backups";
|
device = "192.168.10.2:/mnt/tank/backups";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = ["x-systemd.automount" "noauto" "x-systemd.after=network-online.target" "x-systemd.mount-timeout=90"];
|
options = [
|
||||||
|
"x-systemd.automount"
|
||||||
|
"noauto"
|
||||||
|
"x-systemd.after=network-online.target"
|
||||||
|
"x-systemd.mount-timeout=90"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
user,
|
user,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
options = {
|
||||||
|
restic.enable = lib.mkEnableOption "Enables Restic";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.nfs.enable {
|
||||||
sops.secrets.restic_key = {
|
sops.secrets.restic_key = {
|
||||||
owner = config.users.users.${user}.name;
|
owner = config.users.users.${user}.name;
|
||||||
};
|
};
|
||||||
|
|
@ -13,10 +19,16 @@
|
||||||
repository = "/backups";
|
repository = "/backups";
|
||||||
initialize = true;
|
initialize = true;
|
||||||
passwordFile = "${config.sops.secrets.restic_key.path}";
|
passwordFile = "${config.sops.secrets.restic_key.path}";
|
||||||
paths = ["/home/${user}/repos" "/home/${user}/Documents" "/home/${user}/.local/share/password-store" "/home/${user}/.local/share/buku"];
|
paths = [
|
||||||
|
"/home/${user}/repos"
|
||||||
|
"/home/${user}/Documents"
|
||||||
|
"/home/${user}/.local/share/password-store"
|
||||||
|
"/home/${user}/.local/share/buku"
|
||||||
|
];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
onCalendar = "saturday 23:00";
|
onCalendar = "saturday 23:00";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
outputs,
|
outputs,
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
pkgs,
|
|
||||||
user,
|
user,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
|
@ -14,21 +13,14 @@
|
||||||
# If you want to use modules your own flake exports (from modules/nixos):
|
# If you want to use modules your own flake exports (from modules/nixos):
|
||||||
# outputs.nixosModules.example
|
# outputs.nixosModules.example
|
||||||
../../common/nixos/common.nix
|
../../common/nixos/common.nix
|
||||||
../../common/nixos/laptop.nix
|
|
||||||
../../common/networking/default.nix
|
|
||||||
../../common/nixos/bluetooth.nix
|
|
||||||
../../common/nixos/restic.nix
|
|
||||||
../../common/nixos/ssh/ssh.nix
|
|
||||||
../../common/gui/steam.nix
|
|
||||||
../../common/nixos/ssh/ssh_client.nix
|
|
||||||
../../common/nixos/ssh/ssh_guard.nix
|
|
||||||
../../common/gui/hyprland.nix
|
../../common/gui/hyprland.nix
|
||||||
../../common/gui/default.nix
|
|
||||||
../../common/style/stylix.nix
|
../../common/style/stylix.nix
|
||||||
../../common/virtualization/default.nix
|
../../common/nixos/sysctl
|
||||||
../../common/nixos/sysctl/default.nix
|
|
||||||
|
|
||||||
../../common/networking
|
../../common/networking
|
||||||
|
../../common/nixos
|
||||||
|
../../common/gui
|
||||||
|
../../common/virtualization
|
||||||
|
|
||||||
./auditd.nix
|
./auditd.nix
|
||||||
./kernel.nix
|
./kernel.nix
|
||||||
|
|
@ -49,6 +41,11 @@
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
laptop.enable = true;
|
||||||
|
nfs.enable = true;
|
||||||
|
ssh.enable = true;
|
||||||
|
ssh_guard.enable = true;
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
loader = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue