Created options; Moved tailscale to network folder; Disabled networkmanager wait online; Added repl command; updated firefox interface; other smaller stuff

This commit is contained in:
Jurn Wubben 2025-03-09 15:23:13 +01:00
parent 8d59cbf644
commit c087c07d02
37 changed files with 542 additions and 255 deletions

View file

@ -0,0 +1,3 @@
{
environment.defaultPackages = [];
}

View file

@ -1,20 +1,16 @@
# {
# lib,
# config,
# ...
# }: {
# options.niksos.bluetooth = lib.mkEnableOption;
#
# config = lib.mkIf config.niksos.bluetooth {
# hardware.bluetooth = {
# enable = true;
# input.General.ClassicBondedOnly = false;
# };
# };
# }
{
hardware.bluetooth = {
enable = true;
input.General.ClassicBondedOnly = false;
lib,
config,
pkgs,
...
}: {
options.niksos.bluetooth = lib.mkEnableOption "bluetooth related stuff.";
config = lib.mkIf config.niksos.bluetooth {
hardware.bluetooth = {
enable = true;
input.General.ClassicBondedOnly = false;
};
environment.systemPackages = [pkgs.bluetui];
};
}

View file

@ -1,3 +1,8 @@
{
services.fprintd.enable = true;
config,
lib,
...
}: {
options.niksos.fingerprint = lib.mkEnableOption "fingerprint support.";
config.services.fprintd.enable = config.niksos.fingerprint;
}

View file

@ -1,3 +1,3 @@
{
services.fwupd.enable = true;
{lib, ...}: {
services.fwupd.enable = lib.mkDefault true;
}

View file

@ -1,28 +1,26 @@
# networking configuration
{pkgs, ...}: {
imports = [
./avahi.nix
./tailscale.nix
];
networking = {
# use quad9 with DNS over TLS
nameservers = ["9.9.9.9#dns.quad9.net"];
networkmanager = {
enable = true;
dns = "systemd-resolved";
wifi.powersave = true;
};
};
users.groups.NetworkManager = {};
services = {
openssh = {
enable = true;
settings.UseDns = true;
};
# DNS resolver
resolved = {
enable = true;
dnsovertls = "opportunistic";
};
services.resolved = {
# DNS resolver that tries to encrypt dns traffic
enable = true;
dnsovertls = "opportunistic";
};
systemd.services.NetworkManager-wait-online.serviceConfig.ExecStart = ["" "${pkgs.networkmanager}/bin/nm-online -q"];
systemd.services.NetworkManager-wait-online.enable = false;
}

View file

@ -1,10 +1,10 @@
{
imports = [
./fish.nix
./fonts.nix
./games.nix
./home-manager.nix
./hyprland.nix
./neovim.nix
./polkit.nix
./xdg.nix
];

View file

@ -1,42 +0,0 @@
{}
# Migrated to home-manager stylix.
# {pkgs, ...}: {
# fonts = {
# packages = with pkgs; [
# # icon fonts
# material-symbols
#
# # Sans(Serif) fonts
# libertinus
# noto-fonts
# noto-fonts-cjk-sans
# noto-fonts-emoji
# roboto
# (google-fonts.override {fonts = ["Inter"];})
#
# # monospace fonts
# jetbrains-mono
#
# # nerdfonts
# nerd-fonts.jetbrains-mono
# nerd-fonts.symbols-only
# ];
#
# # causes more issues than it solves
# enableDefaultPackages = false;
#
# # user defined fonts
# # the reason there's Noto Color Emoji everywhere is to override DejaVu's
# # B&W emojis that would sometimes show instead of some Color emojis
# fontconfig.defaultFonts = let
# addAll = builtins.mapAttrs (_: v: v ++ ["Noto Color Emoji"]);
# in
# addAll {
# serif = ["Libertinus Serif"];
# sansSerif = ["Inter"];
# monospace = ["JetBrains Mono Nerd Font"];
# emoji = [];
# };
# };
# }

View file

@ -1,22 +1,64 @@
{pkgs, ...}: {
programs = {
gamescope = {
enable = true;
capSysNice = true;
args = [
"--rt"
"--expose-wayland"
];
};
{
config,
pkgs,
lib,
...
}: {
options.niksos.games = lib.mkEnableOption "gaming related stuff.";
config = lib.mkIf config.niksos.games {
nixpkgs.overlays = [
(final: prev: let
version = "1.4.2";
hash = "sha256-xe0qlbtt06CUK8bXyaGDtCcHOXpSnkbuvcxaDJjeS/c=";
npmHash = "sha256-/+NhlQydGS6+2jEjpbwycwKplVo/++wcdPiBNY3R3FI=";
cargoHash = "sha256-VwzGbm34t7mg9ndmTkht6Ho32NQ+6uxuPTKi3+VrhYo=";
in {
gale = prev.gale.overrideAttrs (new: old: {
src = prev.fetchFromGitHub {
inherit version hash;
owner = "Kesomannen";
repo = "gale";
rev = "1.4.2";
};
npmDeps = prev.fetchNpmDeps {
hash = npmHash;
name = "${new.pname}-${new.version}-npm-deps";
inherit (new) src;
};
cargoDeps = prev.rustPlatform.fetchCargoVendor {
inherit
(new)
pname
version
src
cargoRoot
;
hash = cargoHash;
};
});
})
];
users.users.jsw.packages = [pkgs.gale];
steam = {
enable = true;
programs = {
gamescope = {
enable = true;
capSysNice = true;
args = [
"--rt"
"--expose-wayland"
];
};
extraCompatPackages = [
pkgs.proton-ge-bin
];
steam = {
enable = true;
gamescopeSession.enable = true;
extraCompatPackages = [
pkgs.proton-ge-bin
];
gamescopeSession.enable = true;
};
};
};
}

View file

@ -1,10 +1,19 @@
{pkgs, ...}: {
programs.hyprland = {
enable = true;
withUWSM = true;
{
config,
pkgs,
lib,
...
}: {
options.niksos.desktop = lib.mkEnableOption "desktop related stuff.";
config = lib.mkIf config.niksos.desktop {
programs.hyprland = {
enable = true;
withUWSM = true;
};
environment.systemPackages = [
#FIXME: migrated to home-manager
pkgs.kitty # This is the default config's terminal and also my main one.
];
environment.sessionVariables.NIXOS_OZONE_WL = "1"; # Makes electron apps use wayland.
};
environment.systemPackages = [
pkgs.kitty # This is the default config's terminal and also my main one.
];
environment.sessionVariables.NIXOS_OZONE_WL = "1"; # Makes electron apps use wayland.
}

View file

@ -0,0 +1,4 @@
{lib, ...}: {
options.niksos.neovim = lib.mkEnableOption "the neovim editor";
# The actual config resides in NixOS/home/programs/neovim.
}

View file

@ -1,6 +1,11 @@
{pkgs, ...}: {
{
config,
lib,
pkgs,
...
}: {
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
user.services.polkit-gnome-authentication-agent-1 = lib.mkIf config.niksos.desktop {
description = "polkit-gnome-authentication-agent-1";
wantedBy = ["graphical-session.target"];
wants = ["graphical-session.target"];

View file

@ -1,5 +1,10 @@
{pkgs, ...}: {
xdg.portal = {
{
pkgs,
config,
lib,
...
}: {
xdg.portal = lib.mkIf config.niksos.desktop {
enable = true;
xdgOpenUsePortal = true;
config = {

View file

@ -4,6 +4,6 @@
./kanata.nix
./pipewire.nix
./power.nix
./tailscale.nix
./ssh.nix
];
}

View file

@ -3,21 +3,23 @@
lib,
...
}: {
# greetd display manager
services.greetd = let
session = {
command = "${lib.getExe config.programs.uwsm.package} start hyprland-uwsm.desktop";
user = "jsw";
};
in {
enable = true;
config = lib.mkIf config.niksos.desktop {
# greetd display manager
services.greetd = let
session = {
command = "${lib.getExe config.programs.uwsm.package} start hyprland-uwsm.desktop";
user = "jsw";
};
in {
enable = true;
settings = {
terminal.vt = 1;
default_session = session;
initial_session = session;
settings = {
terminal.vt = 1;
default_session = session;
initial_session = session;
};
};
programs.uwsm.enable = true;
};
programs.uwsm.enable = true;
}

View file

@ -1,11 +1,19 @@
{lib, ...}: {
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
jack.enable = true;
pulse.enable = true;
};
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf config.niksos.desktop {
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
jack.enable = true;
pulse.enable = true;
};
services.pulseaudio.enable = lib.mkForce false;
environment.systemPackages = [pkgs.pulsemixer];
services.pulseaudio.enable = lib.mkForce false; # gnome enables it
};
}

View file

@ -1,5 +1,10 @@
{
services = {
config,
lib,
...
}: {
options.niksos.portable = lib.mkEnableOption "battery optimisers";
config.services = lib.mkIf config.niksos.portable {
logind = {
powerKey = "suspend-then-hibernate";
powerKeyLongPress = "poweroff";

6
system/services/ssh.nix Normal file
View file

@ -0,0 +1,6 @@
{
services.openssh = {
enable = true;
settings.UseDns = true;
};
}

View file

@ -1,3 +0,0 @@
{
services.tailscale.enable = true;
}