more modules and move stuff to modules

This commit is contained in:
twoneis 2024-07-23 23:42:50 +02:00
parent 8fd7302ace
commit 38949ee1b7
7 changed files with 80 additions and 55 deletions

View file

@ -1,72 +1,26 @@
{ inputs, pkgs, lib, config, ... }:
let
inherit (lib) mkDefault;
in {
{ pkgs, config, ... }: {
imports = [
./containers
./fonts
./games
./home
./impermanence
./networking
./niri
./nix
./secureboot
./user
./utils
./vm
];
nixpkgs.config.allowUnfree = true;
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
};
nix = {
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
};
documentation.nixos.enable = false;
networking = {
useDHCP = mkDefault true;
wireless.iwd.enable = true;
extraHosts =
''
10.10.11.245 surveillance.htb
'';
};
time.timeZone = "Europe/Amsterdam";
i18n = {
defaultLocale = "en_US.UTF-8";
};
fonts = {
packages = with pkgs; [
alegreya
alegreya-sans
(nerdfonts.override { fonts = [ "FiraCode" ]; })
roboto
ubuntu_font_family
];
fontconfig = {
defaultFonts = {
serif = [ "Alegreya" ];
sansSerif = [ "Alegreya Sans" ];
monospace = [ "Fira Code Nerd Font" ];
};
};
};
services = {
xserver = {
enable = true;

18
modules/fonts/default.nix Normal file
View file

@ -0,0 +1,18 @@
{ pkgs, ... }: {
fonts = {
packages = with pkgs; [
alegreya
alegreya-sans
(nerdfonts.override { fonts = [ "FiraCode" ]; })
roboto
ubuntu_font_family
];
fontconfig = {
defaultFonts = {
serif = [ "Alegreya" ];
sansSerif = [ "Alegreya Sans" ];
monospace = [ "Fira Code Nerd Font" ];
};
};
};
}

View file

@ -0,0 +1,12 @@
{ lib, ... }: let
inherit (lib) mkDefault;
in {
networking = {
useDHCP = mkDefault true;
wireless.iwd.enable = true;
extraHosts =
''
10.10.11.245 surveillance.htb
'';
};
}

View file

@ -1,10 +1,16 @@
{ inputs, lib, config, pkgs, ... }: {
{ lib, config, pkgs, ... }: let
inherit (lib) mkIf;
inherit (config) withNiri username;
in {
imports = [
./xwl-satellite.service.nix
];
config = lib.mkIf config.withNiri {
nixpkgs.overlays = [ inputs.niri.overlays.niri ];
config = mkIf withNiri {
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
};
programs.niri = {
enable = true;
@ -16,7 +22,7 @@
lidSwitch = "suspend";
};
home-manager.users.${config.username} = {
home-manager.users.${username} = {
home.packages = with pkgs; [
brightnessctl
swaybg

View file

@ -1,4 +1,7 @@
{ lib, config, pkgs, ... }: lib.mkIf config.withNiri {
{ lib, config, pkgs, ... }: let
inherit (lib) mkIf;
inherit (config) withNiri;
in mkIf withNiri {
environment.systemPackages = with pkgs; [ xwayland-satellite xwayland ];
systemd.user.services.xwayland-satellite = {
description = "Xwayland outside your Wayland";

19
modules/nix/default.nix Normal file
View file

@ -0,0 +1,19 @@
{ inputs, ... }: {
imports = [
./nixpkgs.nix
];
nix = {
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
};
}

13
modules/nix/nixpkgs.nix Normal file
View file

@ -0,0 +1,13 @@
{ inputs, lib, config, ... }: let
inherit (lib) mkIf;
in{
nixpkgs = {
overlays = mkIf config.withNiri [
inputs.niri.overlays.niri
];
config = {
allowUnfree = true;
};
};
}