✨ Split up config files to multiple and added imports. Fixed default values for systemConfigs
This commit is contained in:
parent
9611b8bb8d
commit
16c4a8f46b
35
flake.nix
35
flake.nix
@ -23,10 +23,10 @@
|
||||
# ========= Utilities =========
|
||||
#
|
||||
# Secrets management
|
||||
sops-nix = {
|
||||
url = "github:mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# sops-nix = {
|
||||
# url = "github:mic92/sops-nix";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
# };
|
||||
# Catppuccin theming
|
||||
catppuccin = {
|
||||
url = "github:catppuccin/nix";
|
||||
@ -76,7 +76,7 @@
|
||||
lib = nixpkgs.lib.extend customLib;
|
||||
libHm = home-manager.lib.extend customLib;
|
||||
|
||||
systems = [
|
||||
systems = builtins.map (config: defaultAttrs // config) [
|
||||
{
|
||||
hostName = "desktop";
|
||||
system = "x86_64-linux";
|
||||
@ -94,6 +94,16 @@
|
||||
# TODO Homelab config
|
||||
];
|
||||
|
||||
defaultAttrs = {
|
||||
user = {
|
||||
name = common.username;
|
||||
password = "temp";
|
||||
};
|
||||
version = common.system.version;
|
||||
wayland.enable = true;
|
||||
nvidia.enable = false;
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
#
|
||||
@ -110,18 +120,9 @@
|
||||
{
|
||||
hostName,
|
||||
system,
|
||||
user ? {
|
||||
name = common.username;
|
||||
password = "temp";
|
||||
},
|
||||
version ? common.version,
|
||||
wayland ? {
|
||||
enable = true;
|
||||
},
|
||||
nvidia ? {
|
||||
enable = false;
|
||||
},
|
||||
}@systemConfig: # TODO only pass in systemConfig
|
||||
user,
|
||||
...
|
||||
}@systemConfig:
|
||||
|
||||
{
|
||||
name = hostName;
|
||||
|
@ -1,70 +1,11 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
outputs,
|
||||
common,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ./modules ];
|
||||
|
||||
nixpkgs.overlays = [ outputs.overlays.unstable-packages ];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
# Define a user account. Don't forget to set a password with 'passwd'.
|
||||
users.users.${common.username} = {
|
||||
isNormalUser = true;
|
||||
description = common.username;
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
];
|
||||
};
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
environment.sessionVariables = {
|
||||
# Tells Electron apps to use Wayland
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget
|
||||
xdg-utils
|
||||
xdg-desktop-portal
|
||||
xdg-desktop-portal-gtk
|
||||
unstable.protonmail-desktop
|
||||
stremio
|
||||
fastfetch
|
||||
discord
|
||||
nix-prefetch-github # Cmd to get rev and hash from GitHub
|
||||
gimp
|
||||
vlc
|
||||
vdhcoapp # TODO run "vdhcoapp install" on startup
|
||||
onlyoffice-desktopeditors
|
||||
inputs.grayjay.packages.${system}.grayjay
|
||||
imports = [
|
||||
(lib.custom.relativeToRoot "shared/modules")
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
programs.kdeconnect.enable = true;
|
||||
|
||||
services = {
|
||||
flatpak.enable = false;
|
||||
xserver.enable = true;
|
||||
};
|
||||
|
||||
system.stateVersion = common.system.version;
|
||||
}
|
||||
|
@ -1,8 +0,0 @@
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(lib.custom.relativeToRoot "shared/modules")
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
}
|
@ -1,72 +1,23 @@
|
||||
{
|
||||
pkgs,
|
||||
outputs,
|
||||
common,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ./modules ];
|
||||
imports = [
|
||||
(lib.custom.relativeToRoot "shared/modules")
|
||||
./battery.nix
|
||||
./bluetooth.nix
|
||||
./hardware-configuration.nix
|
||||
./security.nix
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [ outputs.overlays.unstable-packages ];
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
# Bootloader.
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Define a user account. Don't forget to set a password with 'passwd'.
|
||||
users.users.${common.username} = {
|
||||
isNormalUser = true;
|
||||
description = common.username;
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
];
|
||||
};
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
environment.sessionVariables = {
|
||||
# Tells Electron apps to use Wayland
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
brightnessctl
|
||||
wget
|
||||
xdg-utils
|
||||
xdg-desktop-portal
|
||||
xdg-desktop-portal-gtk
|
||||
unstable.protonmail-desktop
|
||||
stremio
|
||||
fastfetch
|
||||
discord
|
||||
nix-prefetch-github # Cmd to get rev and hash from GitHub
|
||||
gimp
|
||||
vlc
|
||||
vdhcoapp
|
||||
onlyoffice-desktopeditors
|
||||
hyprsunset # Blue light filter
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
programs.kdeconnect.enable = true;
|
||||
|
||||
services = {
|
||||
flatpak.enable = false;
|
||||
xserver.enable = true;
|
||||
};
|
||||
|
||||
system.stateVersion = common.system.version;
|
||||
}
|
||||
|
@ -1,15 +0,0 @@
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(lib.custom.relativeToRoot "shared/modules")
|
||||
./battery.nix
|
||||
./bluetooth.nix
|
||||
./hardware-configuration.nix
|
||||
./security.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
hyprsunset # Blue light filter
|
||||
];
|
||||
}
|
6
shared/modules/boot.nix
Normal file
6
shared/modules/boot.nix
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
}
|
@ -1,17 +1,28 @@
|
||||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
./development
|
||||
./electron.nix
|
||||
./fonts.nix
|
||||
./gaming
|
||||
./gnome
|
||||
./hardware
|
||||
./kdeconnect.nix
|
||||
./locale.nix
|
||||
./mail.nix
|
||||
./media.nix
|
||||
./networking.nix
|
||||
./nixos.nix
|
||||
./nix-helper.nix
|
||||
./office.nix
|
||||
./hyprland
|
||||
./sddm.nix
|
||||
./security.nix
|
||||
./shell.nix
|
||||
./social.nix
|
||||
./users.nix
|
||||
./qt.nix
|
||||
./xdg.nix
|
||||
./xserver.nix
|
||||
];
|
||||
}
|
||||
|
8
shared/modules/electron.nix
Normal file
8
shared/modules/electron.nix
Normal file
@ -0,0 +1,8 @@
|
||||
{ lib, systemConfig, ... }:
|
||||
|
||||
{
|
||||
environment.sessionVariables = lib.mkIf systemConfig.wayland.enable {
|
||||
# Tells Electron apps to use Wayland
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
}
|
3
shared/modules/kdeconnect.nix
Normal file
3
shared/modules/kdeconnect.nix
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
programs.kdeconnect.enable = true;
|
||||
}
|
7
shared/modules/mail.nix
Normal file
7
shared/modules/mail.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
unstable.protonmail-desktop
|
||||
];
|
||||
}
|
11
shared/modules/media.nix
Normal file
11
shared/modules/media.nix
Normal file
@ -0,0 +1,11 @@
|
||||
{ pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
stremio
|
||||
gimp
|
||||
vlc
|
||||
vdhcoapp
|
||||
inputs.grayjay.packages.${system}.grayjay
|
||||
];
|
||||
}
|
@ -1,6 +1,10 @@
|
||||
{ systemConfig, ... }:
|
||||
{ pkgs, systemConfig, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget
|
||||
];
|
||||
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
hostName = systemConfig.hostName;
|
||||
|
25
shared/modules/nixos.nix
Normal file
25
shared/modules/nixos.nix
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
pkgs,
|
||||
outputs,
|
||||
systemConfig,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
nix-prefetch-github # Cmd to get rev and hash from GitHub
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
nixpkgs = {
|
||||
# Allow unfree packages
|
||||
config.allowUnfree = true;
|
||||
overlays = [ outputs.overlays.unstable-packages ];
|
||||
};
|
||||
|
||||
system.stateVersion = systemConfig.version;
|
||||
}
|
7
shared/modules/office.nix
Normal file
7
shared/modules/office.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
onlyoffice-desktopeditors
|
||||
];
|
||||
}
|
7
shared/modules/social.nix
Normal file
7
shared/modules/social.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
discord
|
||||
];
|
||||
}
|
15
shared/modules/users.nix
Normal file
15
shared/modules/users.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{ systemConfig, ... }:
|
||||
let
|
||||
username = systemConfig.user.name;
|
||||
in
|
||||
{
|
||||
# Define a user without a password, TODO pass in user.password
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
description = username;
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
];
|
||||
};
|
||||
}
|
9
shared/modules/xdg.nix
Normal file
9
shared/modules/xdg.nix
Normal file
@ -0,0 +1,9 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
xdg-utils
|
||||
xdg-desktop-portal
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
}
|
3
shared/modules/xserver.nix
Normal file
3
shared/modules/xserver.nix
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
services.xserver.enable = true;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user