Compare commits

...

4 commits

Author SHA1 Message Date
85caea0cb3
Add ALVR packaging 2023-12-24 11:17:07 +01:00
68e7208177
Add baseline configuration 2023-12-24 11:16:59 +01:00
6ef0dca25f
Add multihost support 2023-12-23 22:05:10 +01:00
20a3fe4538
Switch to nix-starter-configs template 2023-12-23 21:20:40 +01:00
73 changed files with 799 additions and 1870 deletions

View file

@ -1,5 +1,20 @@
{ {
"nodes": { "nodes": {
"hardware": {
"locked": {
"lastModified": 1702453208,
"narHash": "sha256-0wRi9SposfE2wHqjuKt8WO2izKB/ASDOV91URunIqgo=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "7763c6fd1f299cb9361ff2abf755ed9619ef01d6",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixos-hardware",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -7,96 +22,32 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1695108154, "lastModified": 1703113038,
"narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=", "narHash": "sha256-oxkyzjpD+mNT7arzU/zHrkNHLuY9tKwmnD2MNaZiSDw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "07682fff75d41f18327a871088d20af2710d4744", "rev": "0c2353d5d930c3d93724df6858aef064a31b3c00",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-23.05", "ref": "release-23.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"hyprland": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"nixpkgs": [
"nixpkgs-unstable"
],
"systems": "systems",
"wlroots": "wlroots",
"xdph": "xdph"
},
"locked": {
"lastModified": 1697151905,
"narHash": "sha256-sfuiRn7D5D2NzDkXXN/DUUcs2d1ddlf3VmzDBzDO2Tk=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "3a61350286de842c7f1566c38e2b42821080ddf4",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "Hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1691753796,
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"nix-filter": {
"locked": {
"lastModified": 1693833173,
"narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-filter",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1696983906, "lastModified": 1703068421,
"narHash": "sha256-L7GyeErguS7Pg4h8nK0wGlcUTbfUMDu+HMf1UcyP72k=", "narHash": "sha256-WSw5Faqlw75McIflnl5v7qVD/B3S2sLh+968bpOGrWA=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bd1cde45c77891214131cbbea5b1203e485a9d51", "rev": "d65bceaee0fb1e64363f7871bc43dc1c6ecad99f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-23.05", "ref": "nixos-23.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -117,113 +68,12 @@
"type": "github" "type": "github"
} }
}, },
"nur": {
"locked": {
"lastModified": 1697208312,
"narHash": "sha256-pLhWx1QA0hLBgA7KoOeYWxQYqOUYSdoTAoDEEhMGx80=",
"owner": "nix-community",
"repo": "NUR",
"rev": "90683b5b6b475583fb307cd9d557e91881dccbcd",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"hardware": "hardware",
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable"
"nur": "nur",
"split-monitor-workspaces": "split-monitor-workspaces"
}
},
"split-monitor-workspaces": {
"inputs": {
"hyprland": [
"hyprland"
],
"nix-filter": "nix-filter"
},
"locked": {
"lastModified": 1697056199,
"narHash": "sha256-Tkd4cI4Vq6cczZjiZdfs1Q9Gke+4iL1+S3c2GAGhEvc=",
"owner": "Duckonaut",
"repo": "split-monitor-workspaces",
"rev": "9b40de35aeb8c62df3326eae7979b438f3ee0fb1",
"type": "github"
},
"original": {
"owner": "Duckonaut",
"repo": "split-monitor-workspaces",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"wlroots": {
"flake": false,
"locked": {
"host": "gitlab.freedesktop.org",
"lastModified": 1696410538,
"narHash": "sha256-ecDhdYLXWHsxMv+EWG36mCNDvzRbu9qfjH7dLxL7aGM=",
"owner": "wlroots",
"repo": "wlroots",
"rev": "3406c1b17a4a7e6d4e2a7d9c1176affa72bce1bc",
"type": "gitlab"
},
"original": {
"host": "gitlab.freedesktop.org",
"owner": "wlroots",
"repo": "wlroots",
"rev": "3406c1b17a4a7e6d4e2a7d9c1176affa72bce1bc",
"type": "gitlab"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": [
"hyprland",
"hyprland-protocols"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1694628480,
"narHash": "sha256-Qg9hstRw0pvjGu5hStkr2UX1D73RYcQ9Ns/KnZMIm9w=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "8f45a6435069b9e24ebd3160eda736d7a391cbf2",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
} }
} }
}, },

131
flake.nix
View file

@ -1,76 +1,81 @@
#
# flake.nix *
# ├─ ./hosts
# │ └─ default.nix
# ├─ ./darwin
# │ └─ default.nix
# └─ ./nix
# └─ default.nix
#
{ {
description = "Nix, NixOS and Nix Darwin System Flake Configuration"; description = "Your new nix config";
inputs = inputs = {
# References Used by Flake # Nixpkgs
{ nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; # Stable Nix Packages (Default) # You can access packages and modules from different nixpkgs revs
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; # Unstable Nix Packages # at the same time. Here's an working example:
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
home-manager = { # Home manager
# User Environment Manager home-manager.url = "github:nix-community/home-manager/release-23.11";
url = "github:nix-community/home-manager/release-23.05"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs";
hardware.url = "github:nixos/nixos-hardware";
# Shameless plug: looking for a way to nixify your themes and make
# everything match nicely? Try nix-colors!
# nix-colors.url = "github:misterio77/nix-colors";
}; };
nur = { outputs = {
# NUR Community Packages
url = "github:nix-community/NUR"; # Requires "nur.nixosModules.nur" to be added to the host modules
};
hyprland = {
# Official Hyprland Flake
url = "github:hyprwm/Hyprland"; # Requires "hyprland.nixosModules.default" to be added the host modules
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
split-monitor-workspaces = {
url = "github:Duckonaut/split-monitor-workspaces";
inputs.hyprland.follows = "hyprland"; # <- make sure this line is present for the plugin to work as intended
};
};
outputs = inputs @ {
self, self,
nixpkgs, nixpkgs,
nixpkgs-unstable,
home-manager, home-manager,
nur,
hyprland,
split-monitor-workspaces,
... ...
}: } @ inputs: let
# Function telling flake which inputs to use inherit (self) outputs;
let # Supported systems for your flake packages, shell, etc.
vars = { systems = [
# Variables Used In Flake "aarch64-linux"
user = "ghoscht"; "i686-linux"
location = "$HOME/.setup"; "x86_64-linux"
terminal = "alacritty"; "aarch64-darwin"
editor = "nvim"; "x86_64-darwin"
}; ];
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;
in { in {
nixosConfigurations = ( # NixOS Configurations # Your custom packages
import ./hosts { # Accessible through 'nix build', 'nix shell', etc
inherit (nixpkgs) lib; packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
inherit inputs nixpkgs nixpkgs-unstable home-manager nur hyprland split-monitor-workspaces vars; # Inherit inputs # Formatter for your nix files, available through 'nix fmt'
} # Other options beside 'alejandra' include 'nixpkgs-fmt'
); formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
homeConfigurations = ( # Nix Configurations # Your custom packages and modifications, exported as overlays
import ./nix/home.nix { overlays = import ./overlays {inherit inputs;};
inherit (nixpkgs) lib; # Reusable nixos modules you might want to export
inherit inputs nixpkgs nixpkgs-unstable home-manager vars hyprland split-monitor-workspaces; # These are usually stuff you would upstream into nixpkgs
} nixosModules = import ./modules/nixos;
); # Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
adalbert = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./hosts/adalbert
];
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"ghoscht@adalbert" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/ghoscht/adalbert.nix
];
};
};
}; };
} }

41
home/ghoscht/adalbert.nix Normal file
View file

@ -0,0 +1,41 @@
{
inputs,
outputs,
...
}: {
imports = [
./global
];
# colorscheme = inputs.nix-colors.colorschemes.paraiso;
# wallpaper = outputs.wallpapers.cyberpunk-city-red;
#
# # ------ ----- ------
# # | DP-3 | | DP-1| | DP-2 |
# # ------ ----- ------
# monitors = [
# {
# name = "DP-3";
# width = 1920;
# height = 1080;
# x = 0;
# workspace = "3";
# enabled = false;
# }
# {
# name = "DP-1";
# width = 2560;
# height = 1080;
# x = 1920;
# workspace = "1";
# primary = true;
# }
# {
# name = "DP-2";
# width = 1920;
# height = 1080;
# x = 4480;
# workspace = "2";
# }
# ];
}

View file

@ -0,0 +1,78 @@
# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# You can import other home-manager modules here
imports = [
# If you want to use modules your own flake exports (from modules/home-manager):
# outputs.homeManagerModules.example
# Or modules exported from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModules.default
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
permittedInsecurePackages = [
"electron-24.8.6" #fixes Feishin & Webcord
];
# Workaround for https://github.com/nix-community/home-manager/issues/2942
allowUnfreePredicate = _: true;
};
};
nix = {
package = lib.mkDefault pkgs.nix;
settings = {
experimental-features = ["nix-command" "flakes" "repl-flake"];
warn-dirty = false;
};
};
home = {
username = lib.mkDefault "ghoscht";
homeDirectory = lib.mkDefault "/home/${config.home.username}";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
stateVersion = "23.11";
};
# Add stuff for your user as you see fit:
# programs.neovim.enable = true;
# home.packages = with pkgs; [ steam ];
# Enable home-manager and git
programs.home-manager.enable = true;
programs.git.enable = true;
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
}

View file

@ -0,0 +1,80 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# You can import other NixOS modules here
imports = [
# If you want to use modules your own flake exports (from modules/nixos):
# outputs.nixosModules.example
# Or modules from other flakes (such as nixos-hardware):
inputs.hardware.nixosModules.common-cpu-amd
inputs.hardware.nixosModules.common-gpu-nvidia
inputs.hardware.nixosModules.common-pc-ssd
# You can also split up your configuration and import pieces of it here:
# ./users.nix
# Import your generated (nixos-generate-config) hardware configuration
./hardware-configuration.nix
../common/global
../common/users/ghoscht
../common/optional/desktop/awesome.nix
../common/optional/systemd-boot.nix
../common/optional/wireshark.nix
../common/optional/gamemode.nix
../common/optional/kde-connect.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
networking.hostName = "adalbert";
# Force disable Nvidia PRIME, needed by nix-hardware
hardware.nvidia.prime.offload.enable = false;
programs = {
adb.enable = true;
dconf.enable = true;
kdeconnect.enable = true;
};
hardware = {
opengl.enable = true;
opentabletdriver.enable = true;
};
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "23.11";
}

View file

@ -0,0 +1,31 @@
# This file (and the global directory) holds config that i use on all hosts
{
inputs,
outputs,
...
}: {
imports =
[
inputs.home-manager.nixosModules.home-manager
./fish.nix
./locale.nix
./nix.nix
./podman.nix
./power-button.nix
]
++ (builtins.attrValues outputs.nixosModules);
home-manager.extraSpecialArgs = {inherit inputs outputs;};
nixpkgs = {
overlays = builtins.attrValues outputs.overlays;
config = {
allowUnfree = true;
};
};
# Fix for qt6 plugins
environment.profileRelativeSessionVariables = {
QT_PLUGIN_PATH = ["/lib/qt-6/plugins"];
};
}

View file

@ -0,0 +1,17 @@
{
inputs,
pkgs,
...
}: {
programs.fish = {
enable = true;
vendor = {
completions.enable = true;
config.enable = true;
functions.enable = true;
};
useBabelfish = true;
};
users.defaultUserShell = pkgs.fish;
environment.shells = with pkgs; [fish];
}

View file

@ -0,0 +1,19 @@
{lib, ...}: {
time.timeZone = "Europe/Berlin";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
};
console.keyMap = "de";
}

View file

@ -0,0 +1,28 @@
{
inputs,
lib,
...
}: {
nix = {
settings = {
auto-optimise-store = lib.mkDefault true;
experimental-features = ["nix-command" "flakes" "repl-flake"];
warn-dirty = false;
system-features = ["kvm" "big-parallel" "nixos-test"];
};
gc = {
automatic = true;
dates = "weekly";
# Keep the last 3 generations
options = "--delete-older-than +3";
};
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
# Add nixpkgs input to NIX_PATH
# This lets nix2 commands still use <nixpkgs>
nixPath = ["nixpkgs=${inputs.nixpkgs.outPath}"];
};
}

View file

@ -0,0 +1,10 @@
{config, ...}: let
dockerEnabled = config.virtualisation.docker.enable;
in {
virtualisation.podman = {
enable = true;
dockerCompat = !dockerEnabled;
dockerSocket.enable = !dockerEnabled;
defaultNetwork.settings.dns_enabled = true;
};
}

View file

@ -0,0 +1,10 @@
{
inputs,
lib,
...
}: {
services.logind.extraConfig = ''
# dont shutdown when power button is short-pressed
HandlePowerKey=ignore
'';
}

View file

@ -0,0 +1,10 @@
{lib, ...}: {
services.tailscale = {
enable = true;
useRoutingFeatures = lib.mkDefault "client";
};
networking.firewall = {
checkReversePath = "loose";
allowedUDPPorts = [41641]; # Facilitate firewall punching
};
}

View file

@ -0,0 +1,15 @@
{
config,
lib,
pkgs,
...
}: {
imports = [./global.nix ./x11.nix];
services = {
xserver = {
# dpi = 180;
windowManager.awesome.enable = true;
};
};
}

View file

@ -0,0 +1,12 @@
{
config,
lib,
pkgs,
...
}: {
# Enable Flatpak
services.flatpak.enable = true;
# Create folder where all fonts are linked to /run/current-system/sw/share/X11/fonts
fonts.fontDir.enable = true;
}

View file

@ -0,0 +1,18 @@
{
config,
lib,
pkgs,
...
}: {
imports = [./pipewire.nix ../printing.nix ./flatpak.nix ./xdg.nix];
# Enable networking
networking.networkmanager.enable = true;
# Enable for GTK
programs.dconf.enable = true;
services.xserver = {
displayManager.sddm.enable = true;
};
}

View file

@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}: {
imports = [./global.nix ./x11.nix ./wayland.nix];
services = {
xserver = {
desktopManager.gnome = {
enable = true;
};
};
};
}

View file

@ -0,0 +1,11 @@
{
security.rtkit.enable = true;
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
}

View file

@ -0,0 +1,15 @@
{
config,
lib,
pkgs,
...
}: {
# Hint electron apps to use wayland
environment.sessionVariables.NIXOS_OZONE_WL = "1";
environment.systemPackages = with pkgs; [
xwaylandvideobridge
libsForQt5.qt5.qtwayland
qt6.qtwayland
];
}

View file

@ -0,0 +1,28 @@
{
config,
lib,
pkgs,
...
}: {
services = {
# Enable the X11 windowing system.
xserver = {
enable = true;
# Enable touchpad support
libinput.enable = true;
# Remove xterm terminal
excludePackages = with pkgs; [xterm];
modules = [pkgs.xf86_input_wacom];
wacom.enable = true;
};
};
# Install installation
environment = {
systemPackages = with pkgs; [
# X11
xorg.xkbutils
xorg.xkill
];
};
}

View file

@ -0,0 +1,14 @@
{
config,
lib,
pkgs,
...
}: {
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
wlr.enable = true;
extraPortals = with pkgs; [xdg-desktop-portal-gtk];
configPackages = with pkgs; [gnome.gnome-session];
};
}

View file

@ -0,0 +1,5 @@
{
virtualisation.docker = {
enable = true;
};
}

View file

@ -0,0 +1,7 @@
{config, ...}: let
hostname = config.networking.hostName;
in {
boot.initrd = {
luks.devices."${hostname}".device = "/dev/disk/by-label/${hostname}_crypt";
};
}

View file

@ -0,0 +1,3 @@
{
programs.gamemode.enable = true;
}

View file

@ -0,0 +1,22 @@
{
config,
lib,
pkgs,
...
}: {
programs.kdeconnect.enable = true;
# Create system services for KDE connect
systemd.user.services.kdeconnect = {
description = "Adds communication between your desktop and your smartphone";
after = ["graphical-session-pre.target"];
partOf = ["graphical-session.target"];
wantedBy = ["graphical-session.target"];
serviceConfig = {
#Environment = "PATH=${config.home.profileDirectory}/bin";
ExecStart = "${pkgs.plasma5Packages.kdeconnect-kde}/libexec/kdeconnectd";
Restart = "on-abort";
};
};
}

View file

@ -0,0 +1,24 @@
{
config,
lib,
pkgs,
...
}: {
services = {
# Printer Setup
printing.enable = true;
avahi = {
enable = true;
nssmdns = true;
# for a WiFi printer
openFirewall = true;
};
udev.packages = [pkgs.utsushi];
};
# Scanner Setup
hardware.sane = {
enable = true;
extraBackends = [pkgs.utsushi];
};
}

View file

@ -0,0 +1,33 @@
{
pkgs,
config,
...
}: {
console = {
useXkbConfig = true;
earlySetup = false;
};
boot = {
plymouth = {
enable = true;
theme = "spinner-monochrome";
themePackages = [
(pkgs.plymouth-spinner-monochrome.override {
inherit (config.boot.plymouth) logo;
})
];
};
loader.timeout = 0;
kernelParams = [
"quiet"
"loglevel=3"
"systemd.show_status=auto"
"udev.log_level=3"
"rd.udev.log_level=3"
"vt.global_cursor_default=0"
];
consoleLogLevel = 0;
initrd.verbose = false;
};
}

View file

@ -0,0 +1,12 @@
{
config,
lib,
pkgs,
...
}: {
services.hardware.openrgb = {
enable = true;
package = pkgs.openrgb-with-all-plugins;
motherboard = lib.mkDefault config.variables.machine.motherboard;
};
}

View file

@ -0,0 +1,9 @@
{
boot.loader = {
systemd-boot = {
enable = true;
consoleMode = "max";
};
efi.canTouchEfiVariables = true;
};
}

View file

@ -0,0 +1,6 @@
{
imports = [../global/tailscale.nix];
services.tailscale = {
useRoutingFeatures = "both";
};
}

View file

@ -0,0 +1,5 @@
{
programs.wireshark = {
enable = true;
};
}

View file

@ -0,0 +1,7 @@
{
services.xserver.serverFlagsSection = ''
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
'';
}

View file

@ -0,0 +1,44 @@
{
pkgs,
config,
...
}: let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in {
users.users.ghoscht = {
isNormalUser = true;
shell = pkgs.fish;
extraGroups =
[
"wheel"
"video"
"audio"
"camera"
]
++ ifTheyExist [
"minecraft"
"network"
"networkmanager"
"wireshark"
"i2c"
"mysql"
"docker"
"podman"
"git"
"libvirtd"
"deluge"
"lp"
"scanner"
"kvm"
"libvirtd"
"tty"
"dialout"
];
packages = [pkgs.home-manager];
};
home-manager.users.ghoscht = import ../../../../home/ghoscht/${config.networking.hostName}.nix;
security.pam.services = {};
}

View file

@ -1,242 +0,0 @@
{
config,
lib,
pkgs,
unstable,
inputs,
vars,
...
}: {
imports =
(import ../modules/desktops) ++ (import ../modules/shell) ++ [../modules/programs/librewolf.nix ../modules/programs/alacritty.nix] ++ (import ../modules/theming) ++ (import ../modules/coding);
users.users.${vars.user} = {
# System User
isNormalUser = true;
extraGroups = ["wheel" "video" "audio" "camera" "networkmanager" "lp" "scanner" "kvm" "libvirtd" "i2c" "tty" "dialout" "wireshark"];
};
boot.supportedFilesystems = ["ntfs" "exfat"];
# Set default shell -> move to module
users.defaultUserShell = pkgs.fish;
environment.shells = with pkgs; [fish];
programs.fish.enable = true;
services.flatpak.enable = true;
# Enable the X11 windowing system.
# services.xserver.enable = true;
# programs.ssh.startAgent = true;
services.logind.extraConfig = ''
# dont shutdown when power button is short-pressed
HandlePowerKey=ignore
'';
# Enable the KDE Plasma Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
# Configure keymap in X11
# services.xserver = {
# layout = "de";
# xkbVariant = "";
# };
environment.defaultCursor = {
enable = true;
theme = "breeze_cursors";
};
time.timeZone = "Europe/Berlin";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
};
console = {
# font = "Lat2-Terminus16";
keyMap = "de";
};
security = {
rtkit.enable = true;
polkit.enable = true;
};
fonts.fonts = with pkgs; [
# Fonts
carlito # NixOS
vegur # NixOS
source-code-pro
jetbrains-mono
font-awesome # Icons
corefonts # MS
carlito
dejavu_fonts
ipafont
kochi-substitute
source-code-pro
ttf_bitstream_vera
inter
noto-fonts-cjk-sans
(nerdfonts.override {
# Nerdfont Icons override
fonts = [
"JetBrainsMono"
];
})
];
environment = {
variables = {
# Environment Variables
TERMINAL = "${vars.terminal}";
EDITOR = "${vars.editor}";
VISUAL = "${vars.editor}";
};
systemPackages = with pkgs;
[
# System-Wide Packages
# Terminal
btop # Resource Manager
coreutils # GNU Utilities
git # Version Control
killall # Process Killer
nano # Text Editor
neovim
nix-tree # Browse Nix Store
pciutils # Manage PCI
tldr # Helper
usbutils # Manage USB
wget # Retriever
bat
lazygit
fzf
neofetch
jmtpfs # Android MTP
ipinfo
# Video/Audio
alsa-utils # Audio Control
feh # Image Viewer
mpv # Media Player
pavucontrol # Audio Control
pipewire # Audio Server/Control
pulseaudio # Audio Server/Control
jellyfin-media-player
# Apps
appimage-run # Runs AppImages on NixOS
webcord
signal-desktop
alacritty
librewolf
zathura
# File Management
unzip # Zip Files
unrar # Rar Files
zip # Zip
# Shell
fishPlugins.grc
grc
fishPlugins.fzf
fishPlugins.tide
fishPlugins.sponge
fishPlugins.colored-man-pages
fishPlugins.autopair
nix-your-shell
# Other Packages Found @
# - ./<host>/default.nix
# - ../modules
]
++ (with unstable; [
# Terminal
eza
# Apps
feishin
sddm
electron-mail
xournalpp
]);
};
programs = {
dconf.enable = true;
};
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-mozc
fcitx5-gtk
];
};
services = {
printing = {
# CUPS
enable = true;
};
pipewire = {
# Sound
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
};
};
#hardware.pulseaudio.enable = false;
nix = {
# Nix Package Manager Settings
settings = {
auto-optimise-store = true;
};
# gc = { # Garbage Collection
# automatic = true;
# dates = "weekly";
# options = "--delete-older-than 2d";
# };
package = pkgs.nixVersions.unstable; # Enable Flakes
registry.nixpkgs.flake = inputs.nixpkgs;
extraOptions = ''
experimental-features = nix-command flakes
keep-outputs = true
keep-derivations = true
'';
};
nixpkgs.config.allowUnfree = true; # Allow Proprietary Software.
system = {
# NixOS Settings
stateVersion = "23.05";
};
home-manager.users.${vars.user} = {
# Home-Manager Settings
home = {
stateVersion = "23.05";
};
programs = {
home-manager.enable = true;
};
};
}

View file

@ -1,82 +0,0 @@
# NOTE: Dual booted with windows 11. Disable fast-boot in power plan and bios and turn off hibernate to get wifi and bluetooth working. This only works once but on reboot is borked again. So using the old school BLT dongle.
#
{
lib,
pkgs,
vars,
unstable,
...
}: {
imports = [
./hardware-configuration.nix
../../modules/virtualization/docker.nix
../../modules/virtualization/qemu.nix
../../modules/secrets/gnome-keyring.nix
../../modules/secrets/gpg.nix
];
boot = {
# Boot Options
loader = {
systemd-boot = {
enable = true;
configurationLimit = 3;
};
efi = {
canTouchEfiVariables = true;
};
timeout = 5;
};
};
boot.initrd.secrets = {
"/crypto_keyfile.bin" = null;
};
# Enable swap on luks
boot.initrd.luks.devices."luks-4397a73c-b1b9-4fd0-8f7d-21d5159269b8".device = "/dev/disk/by-uuid/4397a73c-b1b9-4fd0-8f7d-21d5159269b8";
boot.initrd.luks.devices."luks-4397a73c-b1b9-4fd0-8f7d-21d5159269b8".keyFile = "/crypto_keyfile.bin";
boot.kernelParams = ["i915.force_probe=9a49"];
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
vaapiVdpau
libvdpau-va-gl
];
};
# i18n.inputmethod = {
# enabled = "fcitx5";
# # fcitx5.addons = with pkgs; [
# # fcitx5-mozc
# # fcitx5-gtk
# # ];
# };
gnome.enable = true;
awesome.enable = true;
services.tailscale.enable = true;
services.tailscale.useRoutingFeatures = "client";
environment = {
etc = {
"wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
bluez_monitor.properties = {
["bluez5.enable-hw-volume"] = false,
}
'';
};
systemPackages = with pkgs;
[
tailscale
nextcloud-client
calibre
libreoffice
element-desktop
]
++ (with unstable; [xournalpp]);
};
}

View file

@ -1,46 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "vmd" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/e36453a3-629d-4704-a42e-180bf3640722";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-5f04c1e9-c3fe-42fb-97d1-0833bf66435a".device = "/dev/disk/by-uuid/5f04c1e9-c3fe-42fb-97d1-0833bf66435a";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/A2B4-1BBE";
fsType = "vfat";
};
swapDevices = [
{device = "/dev/disk/by-uuid/b16f0d66-5aec-4e0e-8162-c8e87e19888c";}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,79 +0,0 @@
{
lib,
inputs,
nixpkgs,
nixpkgs-unstable,
home-manager,
nur,
hyprland,
split-monitor-workspaces,
vars,
...
}: let
system = "x86_64-linux"; # System Architecture
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true; # Allow Proprietary Software
};
unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
lib = nixpkgs.lib;
in {
desktop = lib.nixosSystem {
# Desktop Profile
inherit system;
specialArgs = {
# Pass Flake Variable
inherit inputs system unstable hyprland vars split-monitor-workspaces;
host = {
hostName = "desktop";
mainMonitor = "DP-3";
secondMonitor = "DP-1";
};
};
modules = [
# Modules Used
nur.nixosModules.nur
hyprland.nixosModules.default
./desktop
./configuration.nix
home-manager.nixosModules.home-manager
{
# Home-Manager Module
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
];
};
convertible = lib.nixosSystem {
# Desktop Profile
inherit system;
specialArgs = {
# Pass Flake Variable
inherit inputs system unstable hyprland vars split-monitor-workspaces;
host = {
hostName = "convertible";
mainMonitor = "DP-3";
secondMonitor = "DP-1";
};
};
modules = [
# Modules Used
nur.nixosModules.nur
hyprland.nixosModules.default
./convertible
./configuration.nix
home-manager.nixosModules.home-manager
{
# Home-Manager Module
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
];
};
}

View file

@ -1,71 +0,0 @@
# NOTE: Dual booted with windows 11. Disable fast-boot in power plan and bios and turn off hibernate to get wifi and bluetooth working. This only works once but on reboot is borked again. So using the old school BLT dongle.
#
{
lib,
pkgs,
vars,
unstable,
...
}: {
imports = [
./hardware-configuration.nix
../../modules/hardware/nvidia.nix
../../modules/services/avahi.nix
../../modules/virtualization/docker.nix
../../modules/virtualization/qemu.nix
../../modules/programs/games.nix
../../modules/secrets/gnome-keyring.nix
../../modules/secrets/gpg.nix
# ../../modules/services/easyeffects.nix
];
boot = {
# Boot Options
loader = {
systemd-boot = {
enable = true;
configurationLimit = 3;
};
efi = {
canTouchEfiVariables = true;
};
timeout = 5;
};
kernelPackages = unstable.linuxPackages_latest;
};
hardware = {
sane = {
# Scanning
enable = true;
extraBackends = [unstable.utsushi];
};
};
services.udev.packages = [unstable.utsushi];
# Desktops
hyprland.enable = false;
kde.enable = false;
awesome.enable = true;
programs.kdeconnect.enable = true;
environment = {
systemPackages = with pkgs;
[
# System-Wide Packages
discord # Messaging
obs-studio # Live Streaming
simple-scan # Scanning
firefox
heroic
nextcloud-client
anki
easyeffects
qpwgraph
calibre
]
++ (with unstable; [
libsForQt5.kdeconnect-kde
]);
};
}

View file

@ -1,19 +0,0 @@
{
config,
lib,
pkgs,
unstable,
vars,
...
}: let
in {
home-manager.users.${vars.user} = {
};
programs.adb.enable = true;
users.users.${vars.user}.extraGroups = ["adbusers"];
environment.systemPackages = with unstable; [
android-studio
];
}

View file

@ -1,6 +0,0 @@
[
./nvim.nix
./vscode.nix
./intellij.nix
./android-studio.nix
]

View file

@ -1,16 +0,0 @@
{
config,
lib,
pkgs,
unstable,
vars,
...
}: let
in {
home-manager.users.${vars.user} = {
};
environment.systemPackages = with unstable; [
(jetbrains.plugins.addPlugins jetbrains.idea-ultimate ["ideavim"])
];
}

View file

@ -1,30 +0,0 @@
{
config,
lib,
pkgs,
vars,
...
}: let
in {
home-manager.users.${vars.user} = {
home.file.".config/nvim/lua/custom/" = {
source = ../../rsc/config/nvim;
recursive = true;
};
};
environment.systemPackages = with pkgs; [
gcc
black
python310Packages.debugpy # is this working?
mypy
ruff
nodePackages.pyright
clang-tools_16
rnix-lsp
rust-analyzer
nodePackages.eslint_d
nodePackages.jsonlint
alejandra
];
}

View file

@ -1,87 +0,0 @@
{
config,
lib,
pkgs,
vars,
...
}: let
in {
home-manager.users.${vars.user} = {
programs.vscode = {
enable = true;
package = pkgs.vscodium;
enableUpdateCheck = false;
extensions = with pkgs.vscode-extensions;
[
catppuccin.catppuccin-vsc
pkief.material-icon-theme
vscodevim.vim
bbenoist.nix
ms-python.python
ms-toolsai.jupyter
ms-toolsai.jupyter-renderers
ms-toolsai.jupyter-keymap
]
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "remote-ssh-edit";
publisher = "ms-vscode-remote";
version = "0.47.2";
sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g";
}
{
name = "cpptools";
publisher = "ms-vscode";
version = "1.19.1";
sha256 = "sha256-yUZTLnN4nomFp5I0VgRz7rRMkeMU9QzY+dzEdUUASek=";
}
{
name = "camkes-syntax-highlighting";
publisher = "hensoldt-cyber-gmbh";
version = "1.1.3";
sha256 = "sha256-dRhsFGSjR/Vp5aJgMDwCZQtwmmfNXbM85ViTIq5ORwY=";
}
];
userSettings = {
#Theming
"workbench.colorTheme" = "Catppuccin Mocha";
"catppuccin.accentColor" = "teal";
"workbench.iconTheme" = "material-icon-theme";
"window.menuBarVisibility" = "toggle";
"editor.minimap.autohide" = false;
#Extensions - General
"extensions.autoCheckUpdates" = false;
"extensions.autoUpdate" = false;
# Startup
"workbench.startupEditor" = "none";
# Vim
"editor.lineNumbers" = "relative";
};
keybindings = [
# Navigating Autosuggest and Quick Open entries
{
"key" = "ctrl+j";
"command" = "selectNextSuggestion";
"when" = "suggestWidgetVisible";
}
{
"key" = "ctrl+k";
"command" = "selectPrevSuggestion";
"when" = "suggestWidgetVisible";
}
{
"key" = "ctrl+j";
"command" = "workbench.action.quickOpenSelectNext";
"when" = "inQuickOpen";
}
{
"key" = "ctrl+k";
"command" = "workbench.action.quickOpenSelectPrevious";
"when" = "inQuickOpen";
}
];
};
};
# programs.vscode.package = pkgs.vscodium.fhsWithPackages (ps: with ps; [rustup zlib]);
}

View file

@ -1,82 +0,0 @@
#
# AwesomeWM Configuration
# Enable with "awesome.enable = true;"
#
{
config,
lib,
pkgs,
vars,
...
}:
with lib; {
options = {
awesome = {
enable = mkOption {
type = types.bool;
default = false;
};
};
};
config = mkIf (config.awesome.enable) {
services = {
xserver = {
enable = true;
layout = "de";
# dpi = 180;
libinput.enable = true;
modules = [pkgs.xf86_input_wacom];
wacom.enable = true;
windowManager.awesome.enable = true;
};
};
home-manager.users.${vars.user} = {
home.file.".wallpapers" = {
source = ../../rsc/wallpaper;
recursive = true;
};
home.file.".config/awesome/" = {
source = ../../rsc/config/awesome;
recursive = true;
};
home.file.".config/picom/" = {
source = ../../rsc/config/picom;
recursive = true;
};
home.file.".config/rofi" = {
source = ../../rsc/config/rofi;
recursive = true;
};
home.file.".config/flameshot" = {
source = ../../rsc/config/flameshot;
recursive = true;
};
home.file.".config/zathura" = {
source = ../../rsc/config/zathura;
recursive = true;
};
};
environment = {
systemPackages = with pkgs;
[
picom
rofi
redshift
xbindkeys
clipmenu
flameshot
xclip
brightnessctl
]
++ (with unstable; []);
};
# Flatpak
xdg.portal.enable = true;
xdg.portal.extraPortals = with pkgs; [xdg-desktop-portal-kde];
# Networking
networking.networkmanager.enable = true;
};
}

View file

@ -1,6 +0,0 @@
[
./hyprland.nix
./kde.nix
./gnome.nix
./awesome.nix
]

View file

@ -1,66 +0,0 @@
#
# Gnome Configuration
# Enable with "gnome.enable = true;"
#
{
config,
lib,
pkgs,
vars,
...
}:
with lib; {
options = {
gnome = {
enable = mkOption {
type = types.bool;
default = false;
};
};
};
config = mkIf (config.gnome.enable) {
hardware.pulseaudio.enable = false;
services = {
xserver = {
enable = true;
layout = "de";
libinput.enable = true;
modules = [pkgs.xf86_input_wacom];
wacom.enable = true;
desktopManager.gnome.enable = true; # Desktop Environment
};
udev.packages = with pkgs; [
gnome.gnome-settings-daemon
];
};
environment = {
systemPackages = with pkgs; [
# System-Wide Packages
gnome.adwaita-icon-theme
gnome.dconf-editor
gnome.gnome-tweaks
];
gnome.excludePackages =
(with pkgs; [
# Ignored Packages
gnome-tour
])
++ (with pkgs.gnome; [
atomix
epiphany
geary
gedit
gnome-characters
gnome-contacts
gnome-initial-setup
hitori
iagno
tali
]);
};
};
}

View file

@ -1,289 +0,0 @@
#
# Hyprland Configuration
# Enable with "hyprland.enable = true;"
#
{
config,
lib,
system,
pkgs,
unstable,
hyprland,
vars,
host,
split-monitor-workspaces,
...
}: let
hyprlandconf = ''
monitor = DP-1,1920x1080@75,auto,auto
monitor = DP-3,2560x1440@144,auto,auto
monitor = ,preferred,auto,auto
source = ~/.config/hypr/mocha.conf
exec-once = waybar
exec-once = dunst
exec-once = swww init && swww img ~/.wallpapers/robot.jpg
exec-once = signal-desktop --start-in-tray
exec-once = webcord --start-minimized
env = XCURSOR_SIZE,24
env = LIBVA_DRIVER_NAME,nvidia
env = XDG_SESSION_TYPE,wayland
env = GBM_BACKEND,nvidia-drm
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
env = WLR_NO_HARDWARE_CURSORS,1
env = NIXOS_OZONE_WL,1 # for any ozone-based browser & electron apps to run on wayland
env = MOZ_ENABLE_WAYLAND,1 # for firefox to run on wayland
env = MOZ_WEBRENDER,1
plugin {
split-monitor-workspaces {
count = 9
}
}
input {
kb_layout = de
kb_variant =
kb_model =
kb_options =
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = no
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
general {
gaps_in = 5
gaps_out = 5
border_size = 2
col.active_border = $teal
col.inactive_border = $tealAlpha
layout = dwindle
}
misc {
disable_hyprland_logo = true
vrr = true
vfr = true
}
decoration {
screen_shader = ~/.config/hypr/shaders/nightlight.frag
rounding = 10
blur {
enabled = true
size = 3
passes = 1
}
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
}
animations {
enabled = yes
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
}
master {
new_is_master = true
}
gestures {
workspace_swipe = off
}
$mainMod = SUPER
bind = $mainMod, RETURN, exec, alacritty
bind = $mainMod, SPACE, exec, rofi -i -show drun -modi drun -show-icons
bind = SUPER_SHIFT, C, killactive,
bind = SUPER_SHIFT, Q, exit,
bind = $mainMod, V, togglefloating,
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod, O, split-changemonitorsilent,next
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, split-workspace, 1
bind = $mainMod, 2, split-workspace, 2
bind = $mainMod, 3, split-workspace, 3
bind = $mainMod, 4, split-workspace, 4
bind = $mainMod, 5, split-workspace, 5
bind = $mainMod, 6, split-workspace, 6
bind = $mainMod, 7, split-workspace, 7
bind = $mainMod, 8, split-workspace, 8
bind = $mainMod, 9, split-workspace, 9
bind = $mainMod, 0, split-workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, split-movetoworkspace, 1
bind = $mainMod SHIFT, 2, split-movetoworkspace, 2
bind = $mainMod SHIFT, 3, split-movetoworkspace, 3
bind = $mainMod SHIFT, 4, split-movetoworkspace, 4
bind = $mainMod SHIFT, 5, split-movetoworkspace, 5
bind = $mainMod SHIFT, 6, split-movetoworkspace, 6
bind = $mainMod SHIFT, 7, split-movetoworkspace, 7
bind = $mainMod SHIFT, 8, split-movetoworkspace, 8
bind = $mainMod SHIFT, 9, split-movetoworkspace, 9
bind = $mainMod SHIFT, 0, split-movetoworkspace, 10
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
bind = SUPERSHIFT, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy
bind = $mainMod, L, exec, librewolf
bind = $mainMod SHIFT, L, exec, librewolf --private-window
'';
in
with lib;
with host; {
options = {
hyprland = {
enable = mkOption {
type = types.bool;
default = false;
};
};
};
config = mkIf (config.hyprland.enable) {
environment = {
systemPackages = with pkgs;
[
grim # Grab Images
slurp # Region Selector
wl-clipboard # Clipboard
wlr-randr # Monitor Settings
dunst
cliphist
rofi-wayland
swww
]
++ (with unstable; [waybar]);
# sessionVariables = {
# "NIXOS_OZONE_WL" = "1"; # for any ozone-based browser & electron apps to run on wayland
# "MOZ_ENABLE_WAYLAND" = "1"; # for firefox to run on wayland
# "MOZ_WEBRENDER" = "1";
#
# # for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/
# "LIBVA_DRIVER_NAME" = "nvidia";
# "XDG_SESSION_TYPE" = "wayland";
# "GBM_BACKEND" = "nvidia-drm";
# "__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
# "WLR_NO_HARDWARE_CURSORS" = "1";
# "WLR_EGL_NO_MODIFIRES" = "1";
# };
};
programs = {
hyprland = {
# Window Manager
enable = true;
xwayland.enable = true;
enableNvidiaPatches =
if hostName == "desktop"
then true
else false;
};
};
hardware = {
opengl = {
enable = true;
};
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [xdg-desktop-portal-gtk];
};
home-manager.users.${vars.user} = {
imports = [hyprland.homeManagerModules.default];
home.file.".config/hypr/" = {
source = ../../rsc/config/hypr;
recursive = true;
};
home.file.".config/waybar" = {
source = ../../rsc/config/waybar;
recursive = true;
};
home.file.".config/dunst" = {
source = ../../rsc/config/dunst;
recursive = true;
};
home.file.".config/rofi" = {
source = ../../rsc/config/rofi;
recursive = true;
};
home.file.".wallpapers" = {
source = ../../rsc/wallpaper;
recursive = true;
};
programs.waybar.package = pkgs.waybar.overrideAttrs (oa: {
mesonFlags = (oa.mesonFlags or []) ++ ["-Dexperimental=true"];
patches =
(oa.patches or [])
++ [
(pkgs.fetchpatch {
name = "fix waybar hyprctl";
url = "https://aur.archlinux.org/cgit/aur.git/plain/hyprctl.patch?h=waybar-hyprland-git";
sha256 = "sha256-pY3+9Dhi61Jo2cPnBdmn3NUTSA8bAbtgsk2ooj4y7aQ=";
})
];
});
wayland.windowManager.hyprland = {
enable = true;
systemdIntegration = true;
extraConfig = hyprlandconf;
plugins = [
split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces
];
};
};
nix.settings = {
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
}; # Cache
};
}

View file

@ -1,52 +0,0 @@
#
# KDE Plasma 5 Configuration
# Enable with "kde.enable = true;"
#
{
config,
lib,
pkgs,
vars,
...
}:
with lib; {
options = {
kde = {
enable = mkOption {
type = types.bool;
default = false;
};
};
};
config = mkIf (config.kde.enable) {
services = {
xserver = {
enable = true;
layout = "de";
libinput.enable = true;
modules = [pkgs.xf86_input_wacom];
wacom.enable = true;
#displayManager.defaultSession = "plasmawayland";
desktopManager.plasma5 = {
enable = true; # Desktop Environment
};
};
};
environment = {
systemPackages = with pkgs.libsForQt5; [
# System-Wide Packages
];
plasma5.excludePackages = with pkgs.libsForQt5; [
elisa
khelpcenter
konsole
oxygen
];
};
};
}

View file

@ -1,17 +0,0 @@
{
config,
pkgs,
...
}: {
services.xserver.videoDrivers = ["nvidia"];
hardware = {
opengl.enable = true;
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.stable;
modesetting.enable = true;
powerManagement.enable = false;
open = true;
nvidiaSettings = true;
};
};
}

View file

@ -0,0 +1,6 @@
# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
# These should be stuff you would like to share with others, not your personal configurations.
{
# List your module files here
# my-module = import ./my-module.nix;
}

View file

@ -0,0 +1,6 @@
# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
# These should be stuff you would like to share with others, not your personal configurations.
{
# List your module files here
# my-module = import ./my-module.nix;
}

View file

@ -1,14 +0,0 @@
{
config,
lib,
pkgs,
vars,
...
}: {
home-manager.users.${vars.user} = {
home.file.".config/alacritty" = {
source = ../../rsc/config/alacritty;
recursive = true;
};
};
}

View file

@ -1,24 +0,0 @@
{
config,
pkgs,
nur,
lib,
unstable,
...
}: {
environment.systemPackages = [
unstable.heroic # Game Launcher
unstable.lutris # Game Launcher
unstable.steam # Game Launcher
];
programs = {
steam = {
enable = true;
};
gamemode.enable = true; # Better Gaming Performance
# Steam: Right-click game - Properties - Launch options: gamemoderun %command%
# Lutris: General Preferences - Enable Feral GameMode
# - Global options - Add Environment Variables: LD_PRELOAD=/nix/store/*-gamemode-*-lib/lib/libgamemodeauto.so
};
}

View file

@ -1,25 +0,0 @@
{
config,
lib,
pkgs,
vars,
...
}: {
nixpkgs.config.librewolf.enablePlasmaBrowserIntegration = true;
home-manager.users.${vars.user} = {
programs.librewolf = {
enable = true;
settings = {
"identity.fxaccounts.enabled" = true;
"browser.sessionstore.enabled" = false;
"browser.startup.page" = 1;
"browser.sessionstore.resume_session_once" = true;
"browser.sessionstore.resume_from_crash" = false;
"middlemouse.paste" = false;
"general.autoScroll" = true;
"security.OCSP.require" = false;
};
};
};
}

View file

@ -1,11 +0,0 @@
{
config,
lib,
pkgs,
vars,
...
}: {
security.pam.services.${vars.user}.enableGnomeKeyring = true;
services.gnome.gnome-keyring.enable = true;
programs.seahorse.enable = true;
}

View file

@ -1,30 +0,0 @@
{
config,
lib,
pkgs,
vars,
...
}: {
home-manager.users.${vars.user} = {
programs.gpg = {
enable = true;
};
services.gpg-agent = {
enable = true;
enableSshSupport = true;
enableFishIntegration = true;
enableZshIntegration = true;
pinentryFlavor = "gnome3";
};
# Prevent clobbering SSH_AUTH_SOCK
home.sessionVariables.GSM_SKIP_SSH_AGENT_WORKAROUND = "1";
# Disable gnome-keyring ssh-agent
xdg.configFile."autostart/gnome-keyring-ssh.desktop".text = ''
${lib.fileContents "${pkgs.gnome3.gnome-keyring}/etc/xdg/autostart/gnome-keyring-ssh.desktop"}
Hidden=true
'';
};
}

View file

@ -1,16 +0,0 @@
#
# Network Discoverability (for printers, scanners and such)
#
{
services = {
avahi = {
enable = true;
nssmdns = true;
publish = {
enable = true;
addresses = true;
userServices = true;
};
};
};
}

View file

@ -1 +0,0 @@
[./avahi.nix]

View file

@ -1,15 +0,0 @@
{
config,
lib,
pkgs,
vars,
...
}: {
home-manager.users.${vars.user} = {
services.easyeffects.enable = true;
home.file.".config/easyeffects/output/Beyerdynamic_DT990_Oratory.json" = {
source = ../../rsc/config/easyeffects/Beyerdynamic_DT990_Oratory.json;
};
};
}

View file

@ -1,5 +0,0 @@
[
./git.nix
./fish.nix
./zsh.nix
]

View file

@ -1,30 +0,0 @@
{
config,
lib,
pkgs,
vars,
...
}: {
home-manager.users.${vars.user} = {
programs.fish = {
enable = true;
interactiveShellInit = ''
nix-your-shell fish | source
set fish_greeting
'';
shellAliases = {
lzg = "lazygit";
lzd = "lazydocker";
batt = ''upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -e "percentage" -e "state"'';
hx = "~/Documents/heliox-cli/target/debug/heliox-cli --mode";
slp = "systemctl suspend";
sdn = "shutdown 0";
};
shellAbbrs = {
build = "bash sdk/scripts/open_trentos_build_env.sh sdk/build-system.sh sdk/demos/demo_hello_world rpi3 build-rpi3-Debug-demo_hello_world -DCMAKE_BUILD_TYPE=Debug";
simbuild = "bash sdk/scripts/open_trentos_build_env.sh sdk/build-system.sh sdk/demos/demo_hello_world zynq7000 build-zynq7000-Debug-demo_hello_world -DCMAKE_BUILD_TYPE=Debug";
sim = "sudo bash ../sdk/scripts/open_trentos_test_env.sh ./simulate";
};
};
};
}

View file

@ -1,24 +0,0 @@
{
config,
lib,
pkgs,
vars,
...
}: {
home-manager.users.${vars.user} = {
#Prefer IPv4 for ssh
home.file.".ssh/config".text = "AddressFamily inet";
programs.git = {
enable = true;
userName = "GHOSCHT";
userEmail = "31184695+GHOSCHT@users.noreply.github.com";
extraConfig = {
commit.gpgsign = true;
user.signingkey = "0x2C2C1C62A5388E82";
init.defaultBranch = "main";
};
};
};
}

View file

@ -1,59 +0,0 @@
{
lib,
pkgs,
vars,
...
}: {
home-manager.users.${vars.user} = {
home.file."~/.config/zsh/.p10k.zsh" = {
source = ../../rsc/config/zsh/.p10k.zsh;
};
programs.zsh = {
enable = true;
autocd = true;
dotDir = ".config/zsh";
enableAutosuggestions = true;
enableCompletion = true;
shellAliases = {
sl = "eza";
ls = "eza";
l = "eza -l";
la = "eza -la";
ip = "ip --color=auto";
};
initExtra = ''
[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
nix-your-shell zsh | source /dev/stdin
'';
zplug = {
enable = true;
plugins = [
{
name = "romkatv/powerlevel10k";
tags = ["as:theme" "depth:1"];
}
];
};
plugins = [
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsh";
src = pkgs.fetchFromGitHub {
owner = "chisui";
repo = "zsh-nix-shell";
rev = "v0.7.0";
sha256 = "149zh2rm59blr2q458a5irkfh82y3dwdich60s9670kl3cl5h2m1";
};
}
];
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
};
}

View file

@ -1,44 +0,0 @@
# Module to set a default cursor theme
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.environment.defaultCursor;
indexThemeText = theme: generators.toINI {} {"icon theme" = {Inherits = "${theme}";};};
mkDefaultCursorFile = theme:
pkgs.writeTextDir
"share/icons/default/index.theme"
"${indexThemeText theme}";
defaultCursorPkg = mkDefaultCursorFile cfg.theme;
in {
options = {
environment.defaultCursor = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to set a default cursor theme for graphical environments.
'';
};
theme = mkOption {
type = types.str;
default = "";
example = "Adwaita";
description = "The name of the defualt cursor theme.";
};
};
};
config = mkIf cfg.enable {
environment.systemPackages = [
defaultCursorPkg
];
};
}

View file

@ -1,5 +0,0 @@
[
# ./gtk.nix
# ./qt.nix
./cursor.nix
]

View file

@ -1,20 +0,0 @@
{
config,
lib,
pkgs,
vars,
...
}: {
home-manager.users.${vars.user} = {
gtk.enable = true;
# gtk.cursorTheme.package = pkgs.bibata-cursors;
# gtk.cursorTheme.name = "Bibata-Modern-Ice";
gtk.theme.package = pkgs.adw-gtk3;
gtk.theme.name = "adw-gtk3";
# gtk.iconTheme.package = gruvboxPlus;
# gtk.iconTheme.name = "GruvboxPlus";
};
}

View file

@ -1,31 +0,0 @@
{
config,
lib,
pkgs,
vars,
...
}: {
environment.systemPackages = with pkgs; [
libsForQt5.qtstyleplugins
libsForQt5.qtstyleplugin-kvantum
#other stuff
];
home-manager.users.${vars.user} = {
qt.enable = true;
# platform theme "gtk" or "gnome"
qt.platformTheme = "gtk";
# name of the qt theme
qt.style.name = "adwaita";
# detected automatically:
# adwaita, adwaita-dark, adwaita-highcontrast,
# adwaita-highcontrastinverse, breeze,
# bb10bright, bb10dark, cde, cleanlooks,
# gtk2, motif, plastique
# package to use
qt.style.package = pkgs.adwaita-qt;
};
}

View file

@ -1,18 +0,0 @@
{
config,
pkgs,
vars,
...
}: {
virtualisation = {
docker.enable = true;
};
users.groups.docker.members = ["${vars.user}"];
environment.systemPackages = with pkgs; [
docker # Containers
docker-compose # Multi-Container
lazydocker
];
}

View file

@ -1,42 +0,0 @@
{
config,
pkgs,
vars,
...
}: {
boot.extraModprobeConfig = ''
options kvm_intel nested=1
'';
users.groups.libvirtd.members = ["root" "${vars.user}"];
virtualisation = {
libvirtd = {
enable = true;
qemu = {
verbatimConfig = ''
nvram = [ "${pkgs.OVMF}/FV/OVMF.fd:${pkgs.OVMF}/FV/OVMF_VARS.fd" ]
'';
swtpm.enable = true;
};
};
spiceUSBRedirection.enable = true;
};
environment = {
systemPackages = with pkgs; [
virt-manager # VM Interface
virt-viewer # Remote VM
qemu # Virtualizer
OVMF # UEFI Firmware
gvfs # Shared Directory
swtpm # TPM
virglrenderer # Virtual OpenGL
];
};
services = {
# File Sharing
gvfs.enable = true;
};
}

View file

@ -1,29 +0,0 @@
{
lib,
inputs,
nixpkgs,
home-manager,
hyprland,
split-monitor-workspaces,
vars,
...
}: let
system = "x86_64-linux"; # System Architecture
pkgs = nixpkgs.legacyPackages.${system};
in {
pacman = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {inherit inputs vars hyprland;};
modules = [
# Modules Used
{
home = {
username = "${vars.user}";
homeDirectory = "/home/${vars.user}";
packages = [pkgs.home-manager];
stateVersion = "23.05";
};
}
];
};
}

23
overlays/default.nix Normal file
View file

@ -0,0 +1,23 @@
# This file defines overlays
{inputs, ...}: {
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs {pkgs = final;};
# This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays
modifications = final: prev: {
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });
};
# When applied, the unstable nixpkgs set (declared in the flake inputs) will
# be accessible through 'pkgs.unstable'
unstable-packages = final: _prev: {
unstable = import inputs.nixpkgs-unstable {
system = final.system;
config.allowUnfree = true;
};
};
}

36
pkgs/alvr/default.nix Normal file
View file

@ -0,0 +1,36 @@
{
lib,
appimageTools,
fetchurl,
}: let
pname = "alvr";
version = "20.5.0";
src = fetchurl {
url = "https://github.com/alvr-org/ALVR/releases/download/v${version}/ALVR-x86_64.AppImage";
hash = "sha256-shA93fK/F+PNRv+DCTfvN+tm0w/sj/yPEYc5ms2vHRk=";
};
appimageContents = appimageTools.extractType2 {inherit pname version src;};
in
appimageTools.wrapType2 {
inherit pname version src;
extraInstallCommands = ''
mv $out/bin/${pname}-${version} $out/bin/${pname}
install -Dm444 ${appimageContents}/alvr.desktop -t $out/share/applications
substituteInPlace $out/share/applications/alvr.desktop \
--replace 'Exec=alvr_dashboard' 'Exec=${pname}'
cp -r ${appimageContents}/usr/share/icons $out/share
'';
meta = with lib; {
description = "Stream VR games from your PC to your headset via Wi-Fi";
homepage = "https://github.com/alvr-org/ALVR/";
changelog = "https://github.com/alvr-org/ALVR/releases/tag/v${version}";
license = licenses.mit;
mainProgram = "alvr";
maintainers = with maintainers; [passivelemon];
platforms = ["x86_64-linux"];
};
}

6
pkgs/default.nix Normal file
View file

@ -0,0 +1,6 @@
# Custom packages, that can be defined similarly to ones from nixpkgs
# You can build them using 'nix build .#example'
pkgs: {
# example = pkgs.callPackage ./example { };
alvr = pkgs.callPackage ./alvr {};
}