Cleanup nix files

This commit is contained in:
2023-08-22 19:31:36 +02:00
parent 96f14384b1
commit 685de1c899
12 changed files with 208 additions and 262 deletions
+1 -7
View File
@@ -52,7 +52,7 @@
nixpkgs.lib.nixosSystem {
specialArgs = inputs;
modules = [
./modules/nixos
./modules/misc
# ./modules/gnome
./modules/dwl
nixModules
@@ -131,12 +131,6 @@
in {
nixosConfigurations = {
fuhen = mkSystem "x86_64-linux" "fuhen" {
nixModules = {
fonts.enable = true;
nixconf.enable = true;
wayland.enable = true;
games.enable = true;
};
homeModules = {
apps.enable = true;
zsh.enable = true;
-17
View File
@@ -1,17 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
cfg = config.modules.ntfy;
ntfy = pkgs.writeShellScriptBin "ntfy" (builtins.readFile ./tiramisu.sh);
in {
options.modules.ntfy = {enable = mkEnableOption "ntfy";};
config = mkIf cfg.enable {
home.packages = with pkgs; [ ntfy tiramisu ];
};
}
-3
View File
@@ -1,3 +0,0 @@
#!/usr/bin/env bash
${1:-tiramisu} -s -o '{"title": "#source: #summary", "message": "#body", "topic": "zoriya"}' | xargs -L1 -d\\n curl ntfy.sh -d
+66
View File
@@ -0,0 +1,66 @@
{
lib,
config,
pkgs,
user,
...
}: {
imports = [
./fonts.nix
./impermanence.nix
];
services.printing.enable = true;
security.rtkit.enable = true;
security.polkit.enable = true;
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
jack.enable = true;
pulse.enable = true;
};
hardware.bluetooth.enable = true;
security.sudo.extraConfig = ''
Defaults lecture="never"
'';
boot.loader = {
# Hide the boot loader and show it only on keypress.
timeout = 0;
systemd-boot = {
enable = true;
configurationLimit = 4;
# A real mode for hidpi
consoleMode = "max";
};
efi.canTouchEfiVariables = true;
};
networking.networkmanager.enable = true;
services.automatic-timezoned.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
services.flatpak.enable = true;
hardware.steam-hardware.enable = true;
hardware.opengl.driSupport32Bit = true;
environment.systemPackages = with pkgs; [
wineWowPackages.stable
wineWowPackages.waylandFull
winetricks
];
# boot.kernelPackages = pkgs.linuxPackages_latest;
# This was needed on older versions of the kernel.
#boot.kernelParams = ["i915.force_probe=46a6" "i915.enable_psr=0"];
# Never change this.
system.stateVersion = "22.11";
}
+60
View File
@@ -0,0 +1,60 @@
{
pkgs,
config,
lib,
...
}: {
console = {
font = "ter-i32b";
packages = with pkgs; [terminus_font];
earlySetup = true;
};
fonts = {
packages = with pkgs; [
roboto
dejavu_fonts
# Some japanese fonts
ipafont
kochi-substitute
(nerdfonts.override {fonts = ["JetBrainsMono"];})
];
fontconfig = {
defaultFonts = {
monospace = [
"JetBrainsMono NL Nerd Font"
"IPAGothic"
];
sansSerif = [
"DejaVu Sans"
"IPAPGothic"
];
serif = [
"DejaVu Serif"
"IPAPMincho"
];
};
};
};
i18n.defaultLocale = "en_US.UTF-8";
# Create an FHS mount to support flatpak host icons/fonts
system.fsPackages = [pkgs.bindfs];
fileSystems = let
mkRoSymBind = path: {
device = path;
fsType = "fuse.bindfs";
options = ["ro" "resolve-symlinks" "x-gvfs-hide"];
};
aggregatedFonts = pkgs.buildEnv {
name = "system-fonts";
paths = config.fonts.packages;
pathsToLink = ["/share/fonts"];
};
in {
# icons don't work, don't know why, don't care
# "/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons");
"/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
};
}
+81
View File
@@ -0,0 +1,81 @@
{
lib,
config,
impermanence,
...
}: {
imports = [impermanence.nixosModules.impermanence];
nix = {
settings = {
auto-optimise-store = true;
warn-dirty = false;
experimental-features = ["nix-command" "flakes"];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
extraOptions = ''
keep-outputs = true
keep-derivations = true
'';
};
nixpkgs.config.allowUnfree = true;
environment.persistence."/nix/persist" = {
hideMounts = true;
directories = [
"/var/log"
"/var/lib/bluetooth"
"/var/lib/systemd/coredump"
"/var/lib/docker"
"/var/lib/waydroid"
"/var/lib/flatpak"
"/etc/NetworkManager/system-connections"
];
files = [
"/etc/machine-id"
];
users.zoriya = {
directories = [
"downloads"
"stuff"
"projects"
{
directory = ".gnupg";
mode = "0700";
}
{
directory = ".ssh";
mode = "0700";
}
".local/share/direnv"
".local/share/flatpak"
".local/share/waydroid"
".var"
".cache/flatpak"
".local/share/atuin"
# Cache for sessions (keep website logged in, plugin downloaded...)
".mozilla"
".config/google-chrome"
".config/discord"
".config/YouTube\ Music"
# Don't reinstall plugins on reboot
".local/share/nvim"
".local/state/nvim"
# Gnome accounts
".config/goa-1.0"
".cache/gnome-control-center-goa-helper"
];
files = [
".config/zsh/custom.zsh"
];
};
};
fileSystems."/home/zoriya/wallpapers" = {
device = "/home/zoriya/projects/flake/wallpapers/";
fsType = "none";
options = ["bind"];
};
}
-33
View File
@@ -1,33 +0,0 @@
{pkgs, ...}: {
imports = [
./fonts
./nix
./wayland
./games
];
boot.loader = {
# Hide the boot loader and show it only on keypress.
timeout = 0;
systemd-boot = {
enable = true;
configurationLimit = 4;
# A real mode for hidpi
consoleMode = "max";
};
efi.canTouchEfiVariables = true;
};
networking.networkmanager.enable = true;
services.automatic-timezoned.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# boot.kernelPackages = pkgs.linuxPackages_latest;
# This was needed on older versions of the kernel.
#boot.kernelParams = ["i915.force_probe=46a6" "i915.enable_psr=0"];
# Never change this.
system.stateVersion = "22.11";
}
-46
View File
@@ -1,46 +0,0 @@
{
pkgs,
config,
lib,
...
}: let
cfg = config.fonts;
in {
imports = [./flatpak_fonts.nix];
options.fonts = {enable = lib.mkEnableOption "fonts";};
config = lib.mkIf cfg.enable {
console = {
font = "ter-i32b";
packages = with pkgs; [terminus_font];
earlySetup = true;
};
fonts = {
packages = with pkgs; [
roboto
dejavu_fonts
# Some japanese fonts
ipafont
kochi-substitute
(nerdfonts.override {fonts = ["JetBrainsMono"];})
];
fontconfig = {
defaultFonts = {
monospace = [
"JetBrainsMono NL Nerd Font"
"IPAGothic"
];
sansSerif = [
"DejaVu Sans"
"IPAPGothic"
];
serif = [
"DejaVu Serif"
"IPAPMincho"
];
};
};
};
i18n.defaultLocale = "en_US.UTF-8";
};
}
-24
View File
@@ -1,24 +0,0 @@
{
pkgs,
config,
...
}: {
system.fsPackages = [pkgs.bindfs];
fileSystems = let
mkRoSymBind = path: {
device = path;
fsType = "fuse.bindfs";
options = ["ro" "resolve-symlinks" "x-gvfs-hide"];
};
aggregatedFonts = pkgs.buildEnv {
name = "system-fonts";
paths = config.fonts.packages;
pathsToLink = ["/share/fonts"];
};
in {
# Create an FHS mount to support flatpak host icons/fonts
# icons don't work, don't know why, don't care
# "/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons");
"/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
};
}
-16
View File
@@ -1,16 +0,0 @@
{ pkgs, config, lib, ... }: let
cfg = config.games;
in {
options.games = { enable = lib.mkEnableOption "games"; };
config = lib.mkIf cfg.enable {
services.flatpak.enable = true;
hardware.steam-hardware.enable = true;
hardware.opengl.driSupport32Bit = true;
environment.systemPackages = with pkgs; [
wineWowPackages.stable
wineWowPackages.waylandFull
winetricks
];
};
}
-81
View File
@@ -1,81 +0,0 @@
{
lib,
config,
impermanence,
...
}: let
cfg = config.nixconf;
in {
imports = [ impermanence.nixosModules.impermanence ];
options.nixconf = {enable = lib.mkEnableOption "nix";};
config = lib.mkIf cfg.enable {
nix = {
settings = {
auto-optimise-store = true;
warn-dirty = false;
experimental-features = ["nix-command" "flakes"];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
extraOptions = ''
keep-outputs = true
keep-derivations = true
'';
};
nixpkgs.config.allowUnfree = true;
environment.persistence."/nix/persist" = {
hideMounts = true;
directories = [
"/var/log"
"/var/lib/bluetooth"
"/var/lib/systemd/coredump"
"/var/lib/docker"
"/var/lib/waydroid"
"/var/lib/flatpak"
"/etc/NetworkManager/system-connections"
];
files = [
"/etc/machine-id"
];
users.zoriya = {
directories = [
"downloads"
"stuff"
"projects"
{ directory = ".gnupg"; mode = "0700"; }
{ directory = ".ssh"; mode = "0700"; }
".local/share/direnv"
".local/share/flatpak"
".local/share/waydroid"
".var"
".cache/flatpak"
".local/share/atuin"
# Cache for sessions (keep website logged in, plugin downloaded...)
".mozilla"
".config/google-chrome"
".config/discord"
".config/YouTube\ Music"
# Don't reinstall plugins on reboot
".local/share/nvim"
".local/state/nvim"
# Gnome accounts
".config/goa-1.0"
".cache/gnome-control-center-goa-helper"
];
files = [
".config/zsh/custom.zsh"
];
};
};
fileSystems."/home/zoriya/wallpapers" = {
device = "/home/zoriya/projects/flake/wallpapers/";
fsType = "none";
options = [ "bind" ];
};
};
}
-35
View File
@@ -1,35 +0,0 @@
{
lib,
config,
pkgs,
user,
...
}: let
cfg = config.wayland;
in {
options.wayland = {enable = lib.mkEnableOption "wayland";};
config = lib.mkIf cfg.enable {
services.printing.enable = true;
security.rtkit.enable = true;
security.polkit.enable = true;
# Pipewire just refuses to have a decent mic so I will use pulseaudio for now
# hardware.pulseaudio = {
# enable = true;
# support32Bit = true;
# };
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
jack.enable = true;
pulse.enable = true;
};
hardware.bluetooth.enable = true;
security.sudo.extraConfig = ''
Defaults lecture="never"
'';
};
}