rename common module to nixos

This commit is contained in:
willifan 2025-02-09 16:49:24 +01:00
parent 68cc9cbc1d
commit f22fddbd3e
60 changed files with 1 additions and 1 deletions

View file

@ -0,0 +1,11 @@
{ ... }:
{
system.autoUpgrade = {
enable = true;
dates = "04:00";
flake = "git+ssh://gitea@git.huwe.mooo.com/willifan/nix-config";
persistent = true;
randomizedDelaySec = "5min";
fixedRandomDelay = true;
};
}

View file

@ -0,0 +1,8 @@
{ ... }:
{
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
initrd.systemd.enable = true;
};
}

View file

@ -0,0 +1,14 @@
{ lib, config, ... }:
lib.mkIf config.common.builder.enable {
users.users.builder = {
group = "builder";
isNormalUser = true;
homeMode = "111";
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCRgaPLmdimjvCM7jvlXkRPbw0KOmMdtgTcBahgIWNm8QAFkPX8T42RNDgTb7QG+XqRU4+t4VgM0xt6ldcOTrrcJ2bHW8ybeXM5DU7z2f0aCp3OULosbDHoWiEdxvNmIHcFKgMbL7K/ieVYx5wrPkU+63inK5GrzWIaOOd8O4Q/z7M/XIwOAz2Kb3B4muCG9b9cKAGodOkRT81aJsK0aE84Cy4DbzCgz34FWvfGPWSHQZ/fLNlKrtKI0lCEG5r7r1Tw1wXDAFb7d+enypUwy+KlQDJLkDp0O1dJPEmY0RKXMRL2xFl3jrQ4LgOAyWhXF2ERc2bkky4YaIQfLX3NaMRqVRmUCVpnGRcYqdbn2ulsUOmC0Or/bnJa7/sKFBhFb8aEoxD7/w4h5ugh0xVWMFvwjDb0gymXjNPgvefagAhi8qhxf/6X4AZK4x7y/tcIKpW3QfyrdX7bWQ7itBpMPtYH6WWyoKfypnAGeUtdwcXsb5cwGoJ4s9S/E1CwyZxdC38ydrDYFeRih7+KDHnOqZFnLwBb6yLdpvUhyMkksAzVxh8cvObVgjUFQMAwKvLKVzlv28BLgaWj+K+oFakytRtYZv7CsCneZyL3s/nDKs2ChhYgiXvVicZi+sC8FXZIl6wXWHYj5i/p5A/6ulVFgkfDna051hNewerXuTlyMMbTRw== willifan@pm.me" ];
};
users.groups.builder = { };
nix.settings.trusted-users = [ "builder" "willifan" ];
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
nix.settings.extra-platforms = config.boot.binfmt.emulatedSystems;
}

View file

@ -0,0 +1,40 @@
{ lib, config, inputs, hostname, ... }:
{
imports = [
./desktop
./nixvim
./server
./autoupdate.nix
./boot.nix
./builder.nix
./envvar.nix
./garbage-collect.nix
./keyd.nix
./locales.nix
./mimetype.nix
./optimise.nix
./options.nix
./packages.nix
./sops.nix
./stylix.nix
./syncthing.nix
./users.nix
];
networking = {
networkmanager.enable = true;
hostName = "${hostname}";
};
console.keyMap = "en";
nix = {
settings.experimental-features = [ "nix-command" "flakes" ];
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
};
nixpkgs.config.allowUnfree = true;
system.stateVersion = "23.11";
}

View file

@ -0,0 +1,34 @@
{ lib, config, pkgs, inputs, system, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages =
(with pkgs; [
feh
enpass
proton-pass
vesktop
obsidian
kicad
protonmail-desktop
signal-desktop
piper
qemu
libreoffice
blender
gimp
inkscape
prusa-slicer
UVtools
audacity
])
++
[
inputs.zen.packages.${system}.specific
];
}

View file

@ -0,0 +1,18 @@
{ lib, config, ... }:
lib.mkIf config.desktop.autologin.enable {
security.pam.services.hyprlock = { };
services.greetd = {
enable = true;
settings = rec {
initial_session = {
command = config.desktop.windowManager;
user = "willifan";
};
default_session = initial_session;
};
};
}

View file

@ -0,0 +1,28 @@
{ lib, config, ... }:
lib.mkIf config.desktop.enable {
boot = {
plymouth = {
enable = true;
# theme = "bgrt";
# logo = "${pkgs.nixos-icons}/share/icons/hicolor/48x48/apps/nix-snowflake-white.png";
# font = "${pkgs.dejavu_fonts.minimal}/share/fonts/truetype/DejaVuSans.ttf";
};
consoleLogLevel = 0;
initrd.verbose = false;
kernelParams = [
"quiet"
"splash"
"boot.shell_on_fail"
"loglevel=3"
"rd.systemd.show_status=false"
"rd.udev.log_level=3"
"udev.log_priority=3"
];
# Hide the OS choice for bootloaders.
# It's still possible to open the bootloader list by pressing any key
# It will just not appear on screen unless a key is pressed
loader.timeout = 0;
};
}

View file

@ -0,0 +1,26 @@
{ ... }:
{
imports = [
./games
./applications.nix
./autostart.nix
./boot.nix
./dev.nix
./firefox.nix
./k40.nix
./keyboard.nix
./nfs-client.nix
./nix-ld.nix
./pipewire.nix
./plasma6.nix
./polkit.nix
./printers.nix
./remoteBuilder.nix
./ssh-server.nix
./thunar.nix
./udev.nix
];
}

View file

@ -0,0 +1,8 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.dev.enable {
environment.systemPackages = with pkgs; [
jetbrains.rust-rover
jetbrains.pycharm-community-bin
];
}

View file

@ -0,0 +1,13 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = [
pkgs.firefoxpwa
];
programs.firefox = {
enable = true;
package = pkgs.firefox;
nativeMessagingHosts.packages = [ pkgs.firefoxpwa ];
};
}

View file

@ -0,0 +1,37 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
services.udev.extraRules = ''
# Disable mouse as gamepad
ACTION=="add", SUBSYSTEM=="input", ATTRS{idVendor}=="0b05", ATTRS{idProduct}=="1906", RUN+="/bin/sh -c 'chmod 000 /dev/input/by-id/usb-ASUSTeK_ROG_PUGIO_II-if03-joystick'"
ACTION=="add", SUBSYSTEM=="input", ATTRS{idVendor}=="0b05", ATTRS{idProduct}=="1908", RUN+="/bin/sh -c 'chmod 000 /dev/input/by-id/usb-ASUSTeK_ROG_PUGIO_II-if03-joystick'"
ACTION=="add", SUBSYSTEM=="input", ATTRS{idVendor}=="0b05", ATTRS{idProduct}=="1906", RUN+="/bin/sh -c 'chmod 000 /dev/input/by-id/usb-ASUSTeK_ROG_PUGIO_II-if03-event-joystick'"
ACTION=="add", SUBSYSTEM=="input", ATTRS{idVendor}=="0b05", ATTRS{idProduct}=="1908", RUN+="/bin/sh -c 'chmod 000 /dev/input/by-id/usb-ASUSTeK_ROG_PUGIO_II-if03-event-joystick'"
'';
services.ratbagd = {
enable = true;
package = pkgs.libratbag.overrideAttrs (previousAttrs: {
postInstall = ''
# Ensure the target directory exists
mkdir -p $out/share/libratbag/
# cat the custom configuration file
cat << EOF > $out/share/libratbag/asus-rog-pugio-II.device
[Device]
Name=ASUS ROG Pugio II
DeviceMatch=usb:0b05:1906;usb:0b05:1908
Driver=asus
[Driver/asus]
Profiles=3
Buttons=10
Leds=3
Dpis=4
Wireless=1
DpiRange=100:16000@100
ButtonMapping=f0;f1;f2;e4;e5;e6;0;e8;e9;e1;e2
EOF
'';
});
};
}

View file

@ -0,0 +1,17 @@
{ ... }:
{
imports = [
./ROG_Pugio_II_fixes.nix
./emulation.nix
./mangohud.nix
./minecraft.nix
./moonlight.nix
./steam.nix
./tetrio.nix
./yuzu.nix
];
}

View file

@ -0,0 +1,10 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.emulation.enable {
environment.systemPackages = with pkgs; [
melonDS
dolphin-emu
#lime3ds
cemu
steam-rom-manager
];
}

View file

@ -0,0 +1,6 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = with pkgs; [
mangohud
];
}

View file

@ -0,0 +1,6 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = with pkgs; [
prismlauncher
];
}

View file

@ -0,0 +1,8 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = [
pkgs.moonlight-qt
];
}

View file

@ -0,0 +1,16 @@
{ lib, config, ... }:
lib.mkIf config.desktop.enable {
programs.steam = {
enable = true;
gamescopeSession = {
enable = true;
};
};
hardware.steam-hardware.enable = true;
services.udev.extraRules = ''
SUBSYSTEM=="tty", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2102", MODE="0660", TAG+="uaccess"
'';
}

View file

@ -0,0 +1,8 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = [
pkgs.tetrio-desktop
];
}

View file

@ -0,0 +1,6 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = with pkgs; [
yuzu
];
}

View file

@ -0,0 +1,12 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.laser.enable {
services.udev.extraRules = ''
SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5512", MODE:="0666"
'';
environment.systemPackages = with pkgs; [
k40-whisperer
];
}

View file

@ -0,0 +1,13 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = with pkgs; [
qmk-udev-rules
vial
];
hardware.keyboard.qmk.enable = true;
services.udev.extraRules = ''
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{serial}=="*vial:f64c2b3c*", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
'';
}

View file

@ -0,0 +1,20 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = with pkgs; [
nfs-utils
];
services.autofs = {
enable = true;
autoMaster =
let
mapConf = pkgs.writeText "auto.nfs" ''
roms -fstype=nfs4 192.168.178.19:/roms
'';
in
''
/mnt/nfs ${mapConf}
'';
};
}

View file

@ -0,0 +1,7 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
];
}

View file

@ -0,0 +1,13 @@
{ lib, config, ... }:
lib.mkIf config.desktop.enable {
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
};
}

View file

@ -0,0 +1,6 @@
{ lib, config, ... }:
lib.mkIf config.desktop.wm.plasma6.enable {
services.desktopManager.plasma6 = {
enable = true;
};
}

View file

@ -0,0 +1,24 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = with pkgs; [
polkit_gnome
];
security.polkit.enable = true;
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
}

View file

@ -0,0 +1,13 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
services.printing = {
enable = true;
drivers = [ pkgs.gutenprint pkgs.gutenprintBin ];
};
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
}

View file

@ -0,0 +1,37 @@
{ lib, config, ... }:
lib.mkIf config.desktop.enable {
nix.buildMachines = [
{
hostName = "Anton";
sshUser = "builder";
systems = [ "x86_64-linux" "aarch64-linux" ];
protocol = "ssh-ng";
# if the builder supports building for multiple architectures,
# replace the previous line by, e.g.
# systems = ["x86_64-linux" "aarch64-linux"];
maxJobs = 4;
speedFactor = 2;
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
mandatoryFeatures = [ ];
}
{
hostName = "Puenktchen";
sshUser = "builder";
systems = [ "x86_64-linux" "aarch64-linux" ];
protocol = "ssh-ng";
# if the builder supports building for multiple architectures,
# replace the previous line by, e.g.
# systems = ["x86_64-linux" "aarch64-linux"];
maxJobs = 8;
speedFactor = 4;
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
mandatoryFeatures = [ ];
}
];
nix.distributedBuilds = true;
# optional, useful when the builder has a faster internet connection than yours
nix.extraOptions = ''
builders-use-substitutes = true
'';
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
}

View file

@ -0,0 +1,22 @@
{ lib, config, ... }:
lib.mkIf config.desktop.enable {
services.openssh = {
enable = true;
ports = [ 22 ];
settings = {
PasswordAuthentication = false;
AllowUsers = null; # Allows all users by default. Can be [ "user1" "user2" ]
UseDns = true;
X11Forwarding = false;
PermitRootLogin = "prohibit-password"; # "yes", "without-password", "prohibit-password", "forced-commands-only", "no"
};
};
users.users.willifan.openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDMRriQfw3pusl04fGhCNVoRRpye71ZwkDXAtKB/FP1DLXA4cYrwjLzv/fG1hXi7lAMp2vLiABAg/UaTE8roGzlt62XsFNwc1TI5M8m67J0kLkCtz3MkIixe/3GOFXr03g80DPncLyoIYPvvNd/TftTBK4yrrZPvMJaRrZhW/QdLPQpdHalcNRZ4bnBOCtCoqQ6RGrRi2EeKaJDYIFNl13b9FxrXEJcXnbSDdr1KI3q7a+vkefI2knUf2Uk7ufOWTQ1aqc0heGtCNlHzwZUzW/dfrpPmoVPq3Fqxqd9uXqxMk1Z3VnOwWcK3VXfzzBXKTsX0MaUgF1EqxibkYs9bDZqLEXoRucBqk3wwMPy8RJXqQOupoqa2xEOoduBf1qDHEEm69coHCpPm2mQVUrwsPrmTHmOjh9ir0mkVBDRgHvhq/ctQTVO5/SE2NCgPdlvUV5s44LLsUyxBp5JWwXZWlVys+7Dhil6mtRDcH4CXceJn0VZ61Zv2jrCTxQjKsroitSkNbpAkKajQ9moLMAblsSwJzl3uvJJ3ydlxjZefwTO/GjyuJMY2sIU2Tu0YbIVgMyq5L782LduVlyWj+RLWoEu19OfMqQvTWhJnQPAbR82qGzlfTGRLUxoY+G5MYipJwgrBQ2TnpWvfpTrZxFrglSfekz0v54lWzNZpW+irImh4w== willifan@proton.me"
];
nix.settings.trusted-users = [ "willifan" ];
}

View file

@ -0,0 +1,19 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
services.gvfs.enable = true;
services.tumbler.enable = true;
programs.file-roller.enable = true;
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
}

View file

@ -0,0 +1,2 @@
{ ... }:
{ }

View file

@ -0,0 +1,16 @@
{ ... }:
{
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
# Not officially in the specification
#XDG_BIN_HOME = "$HOME/.local/bin";
#PATH = [
# "${XDG_BIN_HOME}"
#];
};
}

View file

@ -0,0 +1,9 @@
{ ... }:
{
nix.gc = {
automatic = true;
dates = "04:30";
persistent = true;
options = "--delete-older-than 30d";
};
}

View file

@ -0,0 +1,17 @@
{ ... }:
{
services.keyd = {
enable = true;
keyboards.default = {
ids = [ "*" ];
settings = {
main = {
rightalt = "overload(altgr, rightalt)";
capslock = "overload(control, esc)";
};
};
};
};
}

View file

@ -0,0 +1,16 @@
{ ... }:
{
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
i18n.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";
};
}

View file

@ -0,0 +1,15 @@
{ ... }:
{
xdg.mime.defaultApplications = {
"application/pdf" = "zen.desktop";
"text/html" = "zen.desktop";
"x-scheme-handler/http" = "zen.desktop";
"x-scheme-handler/https" = "zen.desktop";
"x-scheme-handler/about" = "zen.desktop";
"x-scheme-handler/unknown" = "zen.desktop";
};
environment.sessionVariables.DEFAULT_BROWSER = "zen";
}

View file

@ -0,0 +1,12 @@
# Plugins
add cmp
try out nvimtree
add lualine
add autopairs
indent blankline??
todo comments
undo tree
bufferline?
startup?
KEYBINDS

View file

@ -0,0 +1,9 @@
{ ... }:
{
programs.nixvim.plugins.nvim-autopairs = {
enable = true;
settings = {
disable_filetype = [ "TelescopePrompt" "vim" ];
};
};
}

View file

@ -0,0 +1,49 @@
{ ... }:
{
programs.nixvim.plugins = {
cmp = {
enable = true;
settings = {
autoEnableSources = true;
experimental = { ghost_text = false; };
performance = {
debounce = 60;
fetchingTimeout = 200;
maxViewEntries = 30;
};
snippet = { expand = "luasnip"; };
formatting = { fields = [ "kind" "abbr" "menu" ]; };
sources = [
{ name = "git"; }
{ name = "nvim_lsp"; }
{ name = "emoji"; }
{
name = "buffer"; # text within current buffer
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
keywordLength = 3;
}
{
name = "path"; # file system paths
keywordLength = 3;
}
{
name = "luasnip"; # snippets
keywordLength = 3;
}
];
window = {
completion = { border = "solid"; };
documentation = { border = "solid"; };
};
};
};
cmp-nvim-lsp = { enable = true; }; # lsp
cmp-buffer = { enable = true; };
cmp-path = { enable = true; }; # file system paths
cmp_luasnip = { enable = true; }; # snippets
cmp-cmdline = { enable = false; }; # autocomplete for cmdline
};
}

View file

@ -0,0 +1,24 @@
{ ... }:
{
programs.nixvim = {
enable = true;
defaultEditor = true;
};
imports = [
./autopairs.nix
./cmp.nix
./filetype.nix
./gitsigns.nix
./illuminate.nix
./lsp.nix
./navic.nix
./neotree.nix
./settings.nix
#./treesitter.nix
./whichkey.nix
./yazi.nix
];
}

View file

@ -0,0 +1,14 @@
{ ... }:
{
programs.nixvim.files = {
"ftplugin/nix.lua" = {
opts = {
expandtab = true;
shiftwidth = 2;
tabstop = 2;
};
};
};
}

View file

@ -0,0 +1,28 @@
{ ... }:
{
programs.nixvim.plugins.gitsigns = {
enable = true;
settings = {
signs = {
add = {
text = " ";
};
change = {
text = " ";
};
delete = {
text = " ";
};
untracked = {
text = "";
};
topdelete = {
text = "󱂥 ";
};
changedelete = {
text = "󱂧 ";
};
};
};
};
}

View file

@ -0,0 +1,18 @@
{ ... }:
{
programs.nixvim.plugins = {
illuminate = {
enable = true;
underCursor = false;
filetypesDenylist = [
"Outline"
"TelescopePrompt"
"alpha"
"harpoon"
"reason"
];
};
};
}

View file

@ -0,0 +1,90 @@
{ ... }:
{
programs.nixvim = {
plugins = {
hmts.enable = true;
lsp-lines = { enable = true; };
lsp-format = { enable = true; };
lsp = {
enable = true;
inlayHints = true;
servers = {
clangd = { enable = true; };
html = { enable = true; };
lua_ls = { enable = true; };
nixd = {
enable = true;
settings = {
formatting.command = [ "nixpkgs-fmt" ];
nixpkgs.expr = "import <nixpkgs> {}";
};
};
pyright = { enable = true; };
gopls = { enable = true; };
jsonls = { enable = true; };
rust_analyzer = {
enable = true;
installCargo = true;
installRustc = true;
};
yamlls = { enable = true; };
};
keymaps = {
silent = true;
lspBuf = {
gd = {
action = "definition";
desc = "Goto Definition";
};
gr = {
action = "references";
desc = "Goto References";
};
gD = {
action = "declaration";
desc = "Goto Declaration";
};
gI = {
action = "implementation";
desc = "Goto Implementation";
};
gT = {
action = "type_definition";
desc = "Type Definition";
};
K = {
action = "hover";
desc = "Hover";
};
"<leader>cw" = {
action = "workspace_symbol";
desc = "Workspace Symbol";
};
"<leader>cr" = {
action = "rename";
desc = "Rename";
};
};
diagnostic = {
"<leader>cd" = {
action = "open_float";
desc = "Line Diagnostics";
};
"[d" = {
action = "goto_next";
desc = "Next Diagnostic";
};
"]d" = {
action = "goto_prev";
desc = "Previous Diagnostic";
};
};
};
};
};
};
}

View file

@ -0,0 +1,42 @@
{ ... }:
{
programs.nixvim.plugins = {
navic = {
enable = true;
settings = {
separator = " ";
highlight = true;
lsp = {
autoAttach = true;
};
icons = {
Array = "󱃵 ";
Boolean = " ";
Class = " ";
Constant = " ";
Constructor = " ";
Enum = " ";
EnumMember = " ";
Event = " ";
Field = "󰽏 ";
File = " ";
Function = "󰡱 ";
Interface = " ";
Key = " ";
Method = " ";
Module = "󰕳 ";
Namespace = " ";
Null = "󰟢 ";
Number = " ";
Object = " ";
Operator = " ";
Package = "󰏖 ";
String = " ";
Struct = " ";
TypeParameter = " ";
Variable = " ";
};
};
};
};
}

View file

@ -0,0 +1,42 @@
{ ... }:
{
programs.nixvim = {
plugins = {
neo-tree = {
enable = true;
sources = [ "filesystem" "buffers" "git_status" "document_symbols" ];
addBlankLineAtTop = false;
filesystem = {
bindToCwd = false;
followCurrentFile = {
enabled = true;
};
};
defaultComponentConfigs = {
indent = {
withExpanders = true;
expanderCollapsed = "󰅂";
expanderExpanded = "󰅀";
expanderHighlight = "NeoTreeExpander";
};
gitStatus = {
symbols = {
added = " ";
conflict = "󰩌 ";
deleted = "󱂥";
ignored = " ";
modified = " ";
renamed = "󰑕";
staged = "󰩍";
unstaged = "";
untracked = " ";
};
};
};
};
};
};
}

View file

@ -0,0 +1,101 @@
{ ... }:
{
programs.nixvim = {
config = {
extraConfigLuaPre =
# lua
''
vim.fn.sign_define("diagnosticsignerror", { text = " ", texthl = "diagnosticerror", linehl = "", numhl = "" })
vim.fn.sign_define("diagnosticsignwarn", { text = " ", texthl = "diagnosticwarn", linehl = "", numhl = "" })
vim.fn.sign_define("diagnosticsignhint", { text = "󰌵", texthl = "diagnostichint", linehl = "", numhl = "" })
vim.fn.sign_define("diagnosticsigninfo", { text = " ", texthl = "diagnosticinfo", linehl = "", numhl = "" })
'';
clipboard = {
providers.wl-copy.enable = true;
};
opts = {
# Show line numbers
number = true;
# Show relative line numbers
relativenumber = true;
# Use the system clipboard
clipboard = "unnamedplus";
# Number of spaces that represent a <TAB>
tabstop = 2;
softtabstop = 2;
# Show tabline always
showtabline = 2;
# Use spaces instead of tabs
expandtab = true;
# Enable smart indentation
smartindent = true;
# Number of spaces to use for each step of (auto)indent
shiftwidth = 2;
# Enable break indent
breakindent = true;
# Highlight the screen line of the cursor
cursorline = true;
# Minimum number of screen lines to keep above and below the cursor
scrolloff = 8;
# Enable mouse support
mouse = "a";
# Set folding method to manual
foldmethod = "manual";
# Disable folding by default
foldenable = false;
# Wrap long lines at a character in 'breakat'
linebreak = true;
# Disable spell checking
spell = false;
# Disable swap file creation
swapfile = false;
# Time in milliseconds to wait for a mapped sequence to complete
timeoutlen = 300;
# Enable 24-bit RGB color in the TUI
termguicolors = true;
# Don't show mode in the command line
showmode = false;
# Open new split below the current window
splitbelow = true;
# Keep the screen when splitting
splitkeep = "screen";
# Open new split to the right of the current window
splitright = true;
# Hide command line unless needed
cmdheight = 0;
# Remove EOB
fillchars = {
eob = " ";
};
};
};
};
}

View file

@ -0,0 +1,13 @@
{ ... }:
{
programs.nixvim.plugins = {
treesitter = {
enable = true;
settings = {
indent.enable = true;
highlight.enable = true;
};
};
};
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim.plugins = {
which-key = {
enable = true;
};
};
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim.plugins = {
yazi = {
enable = true;
};
};
}

View file

@ -0,0 +1,7 @@
{ ... }:
{
nix.optimise = {
automatic = true;
dates = [ "05:00" ];
};
}

View file

@ -0,0 +1,57 @@
{ lib, config, ... }:
{
options = {
common = {
builder.enable = lib.mkOption {
default = false;
type = lib.types.bool;
};
};
desktop = {
enable = lib.mkOption {
default = false;
type = lib.types.bool;
};
emulation.enable = lib.mkOption {
default = false;
type = lib.types.bool;
};
dev.enable = lib.mkOption {
default = false;
type = lib.types.bool;
};
laser.enable = lib.mkOption {
default = false;
type = lib.types.bool;
};
autologin.enable = lib.mkOption {
default = config.desktop.enable;
type = lib.types.bool;
};
windowManager = lib.mkOption {
default = "Hyprland";
type = lib.types.str;
};
wm.plasma6.enable = lib.mkOption {
default = false;
type = lib.types.bool;
};
};
server.enable = lib.mkOption {
default = false;
type = lib.types.bool;
};
};
}

View file

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
tealdeer
];
}

View file

@ -0,0 +1,7 @@
{ lib, config, ... }:
{
imports = [
./ssh-server.nix
];
}

View file

@ -0,0 +1,21 @@
{ lib, config, ... }:
lib.mkIf config.server.enable {
services.openssh = {
enable = true;
ports = [ 22 ];
settings = {
PasswordAuthentication = false;
AllowUsers = null; # Allows all users by default. Can be [ "user1" "user2" ]
UseDns = true;
X11Forwarding = false;
PermitRootLogin = "prohibit-password"; # "yes", "without-password", "prohibit-password", "forced-commands-only", "no"
};
};
users.users.willifan.openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDMRriQfw3pusl04fGhCNVoRRpye71ZwkDXAtKB/FP1DLXA4cYrwjLzv/fG1hXi7lAMp2vLiABAg/UaTE8roGzlt62XsFNwc1TI5M8m67J0kLkCtz3MkIixe/3GOFXr03g80DPncLyoIYPvvNd/TftTBK4yrrZPvMJaRrZhW/QdLPQpdHalcNRZ4bnBOCtCoqQ6RGrRi2EeKaJDYIFNl13b9FxrXEJcXnbSDdr1KI3q7a+vkefI2knUf2Uk7ufOWTQ1aqc0heGtCNlHzwZUzW/dfrpPmoVPq3Fqxqd9uXqxMk1Z3VnOwWcK3VXfzzBXKTsX0MaUgF1EqxibkYs9bDZqLEXoRucBqk3wwMPy8RJXqQOupoqa2xEOoduBf1qDHEEm69coHCpPm2mQVUrwsPrmTHmOjh9ir0mkVBDRgHvhq/ctQTVO5/SE2NCgPdlvUV5s44LLsUyxBp5JWwXZWlVys+7Dhil6mtRDcH4CXceJn0VZ61Zv2jrCTxQjKsroitSkNbpAkKajQ9moLMAblsSwJzl3uvJJ3ydlxjZefwTO/GjyuJMY2sIU2Tu0YbIVgMyq5L782LduVlyWj+RLWoEu19OfMqQvTWhJnQPAbR82qGzlfTGRLUxoY+G5MYipJwgrBQ2TnpWvfpTrZxFrglSfekz0v54lWzNZpW+irImh4w== willifan@proton.me"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCd8g40ehDWL44XbzDY4qbka6FD4oCGA8stA5EqKdORhUqXAqEjw8s8kqNbok13RtSRpC5cgt8dsXG+lXL7A5oldq1u02+yl3YJtyt0nl+cH0WUEHdx7z3uWZPfI2WJh7Q14n0bl/31Rnxsw2A93JTrWqRCs4sV8CG4K8b5WhQSTJEbSO61z7tMEETfag+20FSA2sPP+QZCbxIGdRfTx/aA2pUlkSy5ih0WjwCJlI2wkTQsdsmHuZnPse0QRejbORSfHc/jh7KFFV/KR/UHs4X1EH4dOo4lebigUdtoUwlK9ciBaK1fFCLERJNWMCJOK5zfd3nUEbk7+hXVkAPTB/mDxYub8trpZSCu+3X3z10GM/AuSlk/8lrNQxUpovLffb8bJWSdAH7QdMM/fdgt0YHxt/FEpz5fiB7RHxQ4w/CQC+a+FOVDGFddd4uinX+999ZpshHKnB+R0Yi/7C+XoyhgytNATsPQlWYF367DWXA4cfSmpxchmi1EK4M0XBC8UxtF/EW0ULV2WFAFrO77LKKZ0UkjT7UWv6F3CofY1tAI4Kem6ervegXlasUe3AogiTuIvXfQm5kUk2fgK//VTe4vqQY+BqezHDYgSVbB/FASd0Z5vv+f7zRdqOhLH3ybkjTeQ4MlS0HHO2BCaAKjCmSBBn6w2pC92Qz32uK28w7yhQ== root@Lenni"
];
}

View file

@ -0,0 +1,20 @@
{ ... }:
{
sops.defaultSopsFile = ../../../secrets/secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops.age.keyFile = "/etc/sops/keys.txt";
sops.secrets."root_ssh" = {
owner = "root";
path = "/root/.ssh/id_rsa";
};
sops.secrets."syncthing/password" = {
mode = "440";
owner = "willifan";
};
}

View file

@ -0,0 +1,33 @@
{ pkgs, ... }:
let
wallpaper = pkgs.fetchurl {
url = "https://files.huwe.mooo.com/Oneshot.png";
hash = "sha256-LaIzLCW86sbldE9lk7psbYKaTCjwaPLcoD3il6FalTw=";
};
plymouth_logo = pkgs.fetchurl {
url = "https://files.huwe.mooo.com/outlinenobackground.png";
hash = "sha256-HdErySgSwNSPEHyBywLyZCAss4vUhsY8BvCPe5hST6Q=";
};
in
{
stylix = {
enable = true;
autoEnable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/pasque.yaml";
override = {
base0D = "F3196E";
base0F = "CFAACF";
};
image = wallpaper;
polarity = "dark";
targets.plymouth.logo = plymouth_logo;
};
}

View file

@ -0,0 +1,75 @@
{ lib, config, ... }:
let
deviceList = builtins.attrNames config.common.syncthing.devices;
in
{
options = {
common.syncthing = {
enable = lib.mkEnableOption "enable syncthing";
devices = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule {
options.id = lib.mkOption { type = lib.types.str; };
options.autoAcceptFolders = lib.mkOption {
type = lib.types.bool;
default = true;
};
});
};
basePath = lib.mkOption {
type = lib.types.str;
default = "/mnt/data";
};
};
};
config.home-manager.users.willifan.services.syncthing = lib.mkIf config.common.syncthing.enable {
enable = lib.mkDefault true;
overrideDevices = lib.mkDefault true;
overrideFolders = lib.mkDefault true;
guiAddress = "0.0.0.0:8384";
passwordFile = config.sops.secrets."syncthing/password".path;
settings = {
gui.user = "willifan";
devices = config.common.syncthing.devices;
folders = lib.mkDefault {
"Documents" = {
id = "jtl6g-qjmwo";
path = config.common.syncthing.basePath + "/Documents";
devices = deviceList;
};
"Enpass" = lib.mkDefault {
id = "ciksm-xsw4m";
path = config.common.syncthing.basePath + "/Enpass";
devices = deviceList;
};
"Pictures" = lib.mkDefault {
id = "po4qj-q9t0t";
path = config.common.syncthing.basePath + "/Pictures";
devices = deviceList;
};
"Videos" = lib.mkDefault {
id = "4wqf5-xasng";
path = config.common.syncthing.basePath + "/Videos";
devices = deviceList;
};
"Notes" = lib.mkDefault {
id = "oc61n-iewgj";
path = config.common.syncthing.basePath + "/Notes";
devices = deviceList;
};
"Music" = lib.mkDefault {
id = "xxh8a-3y2tq";
path = config.common.syncthing.basePath + "/Music";
devices = deviceList;
};
};
};
};
}

View file

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
users.users.willifan = {
isNormalUser = true;
linger = true;
description = "willifan";
extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.bash;
};
}