📦 Created config files with common code

- Created common.nix for various configs
- Created theme.nix for theme related configs
- Moved some code to more logical files
- Moved some standalone files into nix multiline strings, in order to
  inject data
This commit is contained in:
2025-01-07 20:18:30 +01:00
parent e223999ae1
commit 1133e01eff
31 changed files with 650 additions and 675 deletions

View File

@ -1,5 +1,3 @@
{ ... }:
{
imports = [
./development.nix
@ -15,5 +13,6 @@
./steam.nix
./stylix.nix
./terminal
./qt.nix
];
}

View File

@ -1,5 +1,9 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
font-awesome # Icons
];
fonts = {
fontconfig.enable = true;
@ -8,6 +12,7 @@
jetbrains-mono
# The line below will replace the lines above in 25.05
# nerd-fonts.jetbrains-mono
font-awesome
];
};

View File

@ -10,15 +10,13 @@
glib
adwaita-icon-theme
gnomeExtensions.appindicator
# gnome-extension-manager
# gnome-extension-manager
loupe
gnome-calculator
gnome-disk-utility
];
programs = {
dconf.enable = true; # Required for some gnome applications
};
programs.dconf.enable = true; # Required for some gnome applications
services = {
gnome.gnome-keyring.enable = true;

View File

@ -1,13 +1,15 @@
{ pkgs, ... }:
let
common = import ../../common.nix;
in
{
environment.systemPackages = with pkgs; [
nautilus
ffmpegthumbnailer
ffmpegthumbnailer # Thumbnails
];
programs.nautilus-open-any-terminal = {
enable = true;
terminal = "kitty";
terminal = common.terminal;
};
}

View File

@ -1,10 +1,6 @@
{
pkgs,
...
}:
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
@ -17,7 +13,7 @@
spotify
];
hardware.pulseaudio.enable = false; # Will be moved to services
hardware.pulseaudio.enable = false; # Will be moved to services in 25.05
security.rtkit.enable = true; # Enable RealtimeKit for audio purposes
@ -32,6 +28,6 @@
# Uncomment the following line if you want to use JACK applications
# jack.enable = true;
};
# pulseaudio.enable = false;
# pulseaudio.enable = false; # TODO uncommenct at 25.05
};
}

View File

@ -1,5 +1,3 @@
{ ... }:
{
imports = [
./audio.nix

View File

@ -1,5 +1,3 @@
{ ... }:
{
hardware.nvidia = {
# Required

View File

@ -1,9 +1,8 @@
# System configurations for Hyprland. For home configs, see ./home/hyprland
# System configurations for Hyprland. For home configs, see ./home-manager/hyprland
{ pkgs, ... }:
{
imports = [
./waybar.nix
./wallpaper.nix
];
@ -11,6 +10,7 @@
xdg-desktop-portal-hyprland
hyprpolkitagent # Auth deamon providing modals for password auth
hyprshot # Screenshots
waybar
];
programs = {

View File

@ -1,12 +0,0 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
waybar
font-awesome # Icons
];
fonts.packages = with pkgs; [
font-awesome
];
}

View File

@ -5,6 +5,7 @@ let
utf-8 = "UTF-8";
en = "en_GB.${utf-8}";
nb = "nb_NO.${utf-8}";
common = import ../common.nix;
in
{
# Configure console keymap
@ -31,10 +32,7 @@ in
};
# Configure keymaps
services.xserver.xkb = {
layout = "gb,no";
options = "grp:alt_shift_toggle"; # Toggle using ALT + SHIFT
};
services.xserver.xkb = common.keymaps;
# Set your time zone.
time.timeZone = "Europe/Oslo";

View File

@ -1,9 +1,10 @@
{ ... }:
let
common = import ../common.nix;
in
{
networking = {
networkmanager.enable = true;
hostName = "nixos";
hostName = common.hostname;
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
};

View File

@ -1,9 +1,7 @@
# Nix-Helper: swgithub.com/viperML/nh
{ ... }:
# Nix-Helper: github.com/viperML/nh
{
programs.nh = {
enable = true;
flake = ./.;
flake = ../.;
};
}

11
modules/qt.nix Normal file
View File

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs.kdePackages; [
qtwayland
qtsvg
qt6ct
];
qt.enable = true;
}

View File

@ -1,10 +1,13 @@
{ pkgs, ... }:
let
theme = import ../theme.nix;
flavor = theme.flavor;
in
{
environment.systemPackages = with pkgs; [
(catppuccin-sddm.override {
flavor = "mocha";
font = "Noto Sans";
flavor = flavor;
font = "JetBrainsMono";
fontSize = "9";
background = "${../catppuccin_high.png}";
loginBackground = true;
@ -13,7 +16,7 @@
services.displayManager.sddm = {
enable = true;
theme = "catppuccin-mocha";
theme = "catppuccin-${flavor}";
autoNumlock = true; # Enable numlock at login # TODO doesn't work
wayland.enable = true;
package = pkgs.kdePackages.sddm;

View File

@ -23,7 +23,7 @@
};
services = {
pcscd.enable = true;
pcscd.enable = true; # Required for Yubikey
udev.packages = with pkgs; [ yubikey-personalization ];
};
}

View File

@ -1,5 +1,3 @@
{ ... }:
{
programs.steam = {
enable = true;

View File

@ -1,12 +1,15 @@
{ pkgs, ... }:
let
theme = import ../theme.nix;
in
{
stylix = {
enable = true;
image = ../catppuccin.png;
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-${theme.flavor}.yaml";
polarity = "dark";
opacity.terminal = 0.8;
# Override some colours because of bad contrast
override = {
base02 = "b0b0b0"; # Comments in shell
base03 = "b0b0b0"; # Comments in nvim