This commit is contained in:
marked 2025-03-29 19:05:05 +01:00
commit 24a865004a
94 changed files with 6074 additions and 0 deletions

19
modules/core/boot.nix Normal file
View file

@ -0,0 +1,19 @@
{ pkgs, config, ... }:
{
boot = {
kernelPackages = pkgs.linuxPackages_zen;
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
# AppImage support
binfmt.registrations.appimage = {
wrapInterpreterInShell = 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'';
};
plymouth.enable = true;
};
}

25
modules/core/default.nix Normal file
View file

@ -0,0 +1,25 @@
{ inputs, ... }:
{
imports = [
./boot.nix
./fonts.nix
#./sddm.nix
./greetd.nix
#./hardware.nix
./network.nix
./packages.nix
./printing.nix
./security.nix
./services.nix
./starfish.nix
./stylix.nix
./system.nix
./thunar.nix
./user.nix
./virtualisation.nix
./xserver.nix
./nh.nix
inputs.stylix.nixosModules.stylix
];
}

14
modules/core/fonts.nix Normal file
View file

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
fonts = {
packages = with pkgs; [
noto-fonts-emoji
noto-fonts-cjk-sans
font-awesome
symbola
material-icons
nerd-fonts.jetbrains-mono
];
};
}

14
modules/core/greetd.nix Normal file
View file

@ -0,0 +1,14 @@
{ pkgs, username, ... }:
{
services.greetd = {
enable = true;
vt = 3;
settings = {
default_session = {
user = username;
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland";
};
};
};
}

11
modules/core/network.nix Normal file
View file

@ -0,0 +1,11 @@
{ pkgs, host, options, ... }:
{
networking = {
hostName = "${host}";
networkmanager.enable = true;
timeServers = options.networking.timeServers.default ++ ["pool.ntp.org"];
};
environment.systemPackages = with pkgs; [ networkmanagerapplet ];
}

17
modules/core/nh.nix Normal file
View file

@ -0,0 +1,17 @@
{ pkgs, username, ... }:
{
programs.nh = {
enable = true;
clean = {
enable = true;
extraArgs = "--keep-since 7d --keep 5";
};
flake = "/etc/nixos";
};
environment.systemPackages = with pkgs; [
nix-output-monitor
nvd
];
}

56
modules/core/packages.nix Normal file
View file

@ -0,0 +1,56 @@
{ pkgs, inputs, host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) dockerEnable;
in
{
programs = {
hyprland.enable = true;
seahorse.enable = true;
adb.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
};
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
inputs.zen-browser.packages."${system}".beta # Firefox fork
htop # CLI sysusage tool
ffmpeg # Video / audio editing
eza # LS replacement
duf # Disk usage util
] ++ (if dockerEnable then [ docker-compose ] else []) ++ [
brightnessctl # Brightness control
gimp # Image editor
hyprpicker # Color picker
eog # Image viewer
macchina # CLI sysinfo tool
libnotify # Notifications
lm_sensors # Hardware temps
lshw # Detailed hardware information
mpv # Video player
nwg-displays # Monitor configs via GUI
pciutils # Collection of tools for inspecting PCI devices
ripgrep # grep++
socat # Screenshot util
unrar # .rar files
unzip # .zip files
wget # CLI fetch
yazi # TUI file manager
appimage-run # AppImage support
kitty-themes # Themes for Kitty
base16-schemes # Schemes for stylix
vim # Text editor
fuse # Virtual file systems
greetd.tuigreet # Display Manager
#(callPackage ../../packages/sddm-rose-pine.nix {}) # SDDM theme
] ++ [
rustup # Rust toolchain manager
clang # C compiler
llvmPackages.bintools # LLVM
(callPackage ../../packages/luau-lsp.nix { stdenv = pkgs.clangStdenv; }) # Luau-Lsp
(callPackage ../../packages/luau.nix { stdenv = pkgs.clangStdenv; }) # Luau
];
}

17
modules/core/printing.nix Normal file
View file

@ -0,0 +1,17 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) printEnable;
in
{
services = {
printing = {
enable = printEnable;
};
avahi = {
enable = printEnable;
nssmdns4 = true;
openFirewall = true;
};
ipp-usb.enable = printEnable;
};
}

8
modules/core/sddm.nix Normal file
View file

@ -0,0 +1,8 @@
{ pkgs, username, ... }:
{
services.displayManager.sddm = {
enable = true;
theme = "rose-pine";
};
}

22
modules/core/security.nix Normal file
View file

@ -0,0 +1,22 @@
_:
{
security = {
rtkit.enable = true;
polkit = {
enable = true;
extraConfig = ''
polkit.addRule(function(action, subject) {
if ( subject.isInGroup("users") && (
action.id == "org.freedesktop.login1.reboot" ||
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
action.id == "org.freedesktop.login1.power-off" ||
action.id == "org.freedesktop.login1.power-off-multiple-sessions"
))
{ return polkit.Result.YES; }
})
'';
};
pam.services.hyprlock = {};
};
}

19
modules/core/services.nix Normal file
View file

@ -0,0 +1,19 @@
{ profile, ... }:
{
services = {
libinput.enable = true;
gvfs.enable = true; # Mounting USB & more
openssh.enable = true;
tumbler.enable = true; # Image/video preview
gnome.gnome-keyring.enable = true;
pulseaudio.enable = false;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
};
}

79
modules/core/starfish.nix Normal file
View file

@ -0,0 +1,79 @@
{
...
}:
{
programs = {
starship = {
enable = true;
settings = {
add_newline = false;
buf = {
symbol = " ";
};
c = {
symbol = " ";
};
directory = {
read_only = " 󰌾";
};
docker_context = {
symbol = " ";
};
fossil_branch = {
symbol = " ";
};
git_branch = {
symbol = " ";
};
golang = {
symbol = " ";
};
hg_branch = {
symbol = " ";
};
hostname = {
ssh_symbol = " ";
};
lua = {
symbol = " ";
};
memory_usage = {
symbol = "󰍛 ";
};
meson = {
symbol = "󰔷 ";
};
nim = {
symbol = "󰆥 ";
};
nix_shell = {
symbol = " ";
};
nodejs = {
symbol = " ";
};
ocaml = {
symbol = " ";
};
package = {
symbol = "󰏗 ";
};
python = {
symbol = " ";
};
rust = {
symbol = " ";
};
swift = {
symbol = " ";
};
zig = {
symbol = " ";
};
};
};
};
}

20
modules/core/steam.nix Normal file
View file

@ -0,0 +1,20 @@
{ pkgs, ... }:
{
programs = {
steam = {
enable = true;
gamescopeSession.enable = true;
extraCompatPackages = with pkgs; [ proton-ge-bin ];
};
gamescope = {
enable = true;
capSysNice = true;
args = [
"--rt"
"--expose-wayland"
];
};
};
}

57
modules/core/stylix.nix Normal file
View file

@ -0,0 +1,57 @@
{ lib, pkgs, host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) stylixImage themeByImage;
in
{
stylix = {
enable = true;
#image = stylixImage;
image = lib.mkIf (themeByImage == true) stylixImage;
polarity = "dark";
opacity.terminal = 1.0;
#base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml";
base16Scheme = lib.mkIf (themeByImage == false) {
base00 = "191724";
base01 = "1f1d2e";
base02 = "26233a";
base03 = "6e6a86";
base04 = "908caa";
base05 = "e0def4";
base06 = "e0def4";
base07 = "524f67";
base08 = "eb6f92";
base09 = "f6c177";
base0A = "ebbcba";
base0B = "31748f";
base0C = "9ccfd8";
base0D = "c4a7e7";
base0E = "f6c177";
base0F = "524f67";
};
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 24;
};
fonts = {
monospace = {
package = pkgs.nerd-fonts.jetbrains-mono;
name = "JetBrains Mono";
};
sansSerif = {
package = pkgs.montserrat;
name = "Montserrat";
};
serif = {
package = pkgs.montserrat;
name = "Montserrat";
};
sizes = {
applications = 12;
terminal = 15;
desktop = 11;
popups = 12;
};
};
};
}

34
modules/core/system.nix Normal file
View file

@ -0,0 +1,34 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) consoleKeyMap;
in
{
nix = {
settings = {
download-buffer-size = 250000000;
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
};
};
time.timeZone = "Europe/Warsaw";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "pl_PL.UTF-8";
LC_IDENTIFICATION = "pl_PL.UTF-8";
LC_MEASUREMENT = "pl_PL.UTF-8";
LC_MONETARY = "pl_PL.UTF-8";
LC_NAME = "pl_PL.UTF-8";
LC_NUMERIC = "pl_PL.UTF-8";
LC_PAPER = "pl_PL.UTF-8";
LC_TELEPHONE = "pl_PL.UTF-8";
LC_TIME = "pl_PL.UTF-8";
};
console.keyMap = "${consoleKeyMap}";
system.stateVersion = "24.11"; # Do not change this!
}

18
modules/core/thunar.nix Normal file
View file

@ -0,0 +1,18 @@
{ host, pkgs, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) thunarEnable;
in
{
programs = {
thunar = {
enable = thunarEnable;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
};
environment.systemPackages = with pkgs; [
ffmpegthumbnailer # Video/image preview
];
}

39
modules/core/user.nix Normal file
View file

@ -0,0 +1,39 @@
{ pkgs, inputs, username, host, profile, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) gitUsername;
in
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs = false;
backupFileExtension = "backup";
extraSpecialArgs = { inherit inputs username host profile; };
users.${username} = {
imports = [ ./../home ];
home = {
username = "${username}";
homeDirectory = "/home/${username}";
stateVersion = "24.11";
};
programs.home-manager.enable = true;
};
};
users.mutableUsers = true;
users.users.${username} = {
isNormalUser = true;
description = "${gitUsername}";
extraGroups = [
"docker"
"networkmanager"
"wheel"
"libvirtd"
"lp"
"scanner"
"adbusers"
];
shell = pkgs.zsh;
ignoreShellProgramCheck = true;
};
nix.settings.allowed-users = [ "${username}" ];
}

View file

@ -0,0 +1,16 @@
{ pkgs, host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) libvirtdEnable dockerEnable podmanEnable;
in
{
# Only enable either docker or podman, never both
virtualisation = {
libvirtd.enable = libvirtdEnable;
docker.enable = dockerEnable;
podman.enable = podmanEnable;
};
programs = {
virt-manager.enable = libvirtdEnable;
};
environment.systemPackages = if libvirtdEnable then [ pkgs.virt-viewer ] else [];
}

13
modules/core/xserver.nix Normal file
View file

@ -0,0 +1,13 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) keyboardLayout;
in
{
services.xserver = {
enable = true;
xkb = {
layout = "${keyboardLayout}";
variant = "";
};
};
}