From dcd5accea05a7228979d2d75f7366ce6f041bd32 Mon Sep 17 00:00:00 2001 From: Leyla Becker Date: Sat, 21 Sep 2024 11:26:18 -0500 Subject: [PATCH] ran linter --- enviroments/client/default.nix | 9 +-- enviroments/common/default.nix | 17 +++-- enviroments/server/default.nix | 76 ++++++++++++++------ flake.nix | 84 +++++++++++----------- hosts/defiant/configuration.nix | 27 +++---- hosts/defiant/disko-config.nix | 16 ++--- hosts/defiant/hardware-configuration.nix | 26 ++++--- hosts/hardware-common.nix | 5 +- hosts/horizon/configuration.nix | 23 +++--- hosts/horizon/hardware-configuration.nix | 85 +++++++++++------------ hosts/twilight/configuration.nix | 23 +++--- hosts/twilight/hardware-configuration.nix | 84 +++++++++++----------- overlays/intellij.nix | 5 +- overlays/vscodium.nix | 5 +- pkgs/default.nix | 6 +- templates/default.nix | 3 +- users/default.nix | 9 ++- users/ester/default.nix | 21 +++--- users/eve/default.nix | 21 +++--- users/leyla/default.nix | 23 +++--- users/leyla/home.nix | 34 ++++----- users/leyla/packages.nix | 74 +++++++++++--------- util/default.nix | 5 +- 23 files changed, 372 insertions(+), 309 deletions(-) diff --git a/enviroments/client/default.nix b/enviroments/client/default.nix index 555305f..86ff67b 100644 --- a/enviroments/client/default.nix +++ b/enviroments/client/default.nix @@ -1,11 +1,9 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { imports = [ ../common ]; services = { - # Enable CUPS to print documents. printing.enable = true; @@ -21,7 +19,7 @@ }; # Get rid of xTerm - excludePackages = [ pkgs.xterm ]; + excludePackages = [pkgs.xterm]; # Configure keymap in X11 xkb = { @@ -44,7 +42,6 @@ }; }; - # Enable sound with pipewire. hardware.pulseaudio.enable = false; security.rtkit.enable = true; @@ -57,4 +54,4 @@ gnomeExtensions.dash-to-dock ]; -} \ No newline at end of file +} diff --git a/enviroments/common/default.nix b/enviroments/common/default.nix index 99f3e5a..96ad012 100644 --- a/enviroments/common/default.nix +++ b/enviroments/common/default.nix @@ -1,11 +1,10 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { imports = [ - ../../users + ../../users ]; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - nix.settings.trusted-users = [ "leyla" ]; + nix.settings.experimental-features = ["nix-command" "flakes"]; + nix.settings.trusted-users = ["leyla"]; # Enable networking networking.networkmanager.enable = true; @@ -32,10 +31,10 @@ services = { openssh = { enable = true; - ports = [ 22 ]; + ports = [22]; settings = { PasswordAuthentication = false; - AllowUsers = [ "leyla" ]; # Allows all users by default. Can be [ "user1" "user2" ] + AllowUsers = ["leyla"]; # Allows all users by default. Can be [ "user1" "user2" ] UseDns = true; X11Forwarding = false; }; @@ -47,7 +46,7 @@ defaultSopsFormat = "yaml"; gnupg.sshKeyPaths = []; - age ={ + age = { keyFile = "/var/lib/sops-nix/key.txt"; sshKeyPaths = []; # generateKey = true; @@ -68,4 +67,4 @@ iputils dnsutils ]; -} \ No newline at end of file +} diff --git a/enviroments/server/default.nix b/enviroments/server/default.nix index 3bdc8c4..8b32992 100644 --- a/enviroments/server/default.nix +++ b/enviroments/server/default.nix @@ -1,21 +1,40 @@ -{ config, pkgs, ... }: { + config, + pkgs, + ... +}: { imports = [ ../common ]; - users.groups.jellyfin_media = { - members = ["jellyfin" "leyla" "ester" "eve"]; - }; + users = { + groups = { + jellyfin_media = { + members = ["jellyfin" "leyla" "ester" "eve"]; + }; - users.groups.jellyfin = { - members = ["jellyfin" "leyla"]; - }; + jellyfin = { + members = ["jellyfin" "leyla"]; + }; - users.users.jellyfin = { - uid = 2000; - group = "jellyfin"; - isSystemUser = true; + # forgejo = { + # members = ["forgejo" "leyla"]; + # }; + }; + + users = { + jellyfin = { + uid = 2000; + group = "jellyfin"; + isSystemUser = true; + }; + + # forgejo = { + # uid = 2001; + # group = "forgejo"; + # isSystemUser = true; + # }; + }; }; systemd.tmpfiles.rules = [ @@ -23,11 +42,14 @@ "d /home/jellyfin/media 775 jellyfin jellyfin_media -" "d /home/jellyfin/config 750 jellyfin jellyfin -" "d /home/jellyfin/cache 755 jellyfin jellyfin_media -" + # "d /home/forgejo 750 forgejo forgejo -" + # "d /home/forgejo/data 750 forgejo forgejo -" ]; services = let jellyfinDomain = "jellyfin.jan-leila.com"; headscaleDomain = "headscale.jan-leila.com"; + # forgejoDomain = "forgejo.jan-leila.com"; in { nfs.server = { enable = true; @@ -59,6 +81,20 @@ openFirewall = false; }; + # TODO: figure out what needs to be here + # forgejo = { + # enable = true; + # database.type = "postgres"; + # lfs.enable = true; + # settings = { + # server = { + # DOMAIN = forgejoDomain; + # HTTP_PORT = 8081; + # }; + # service.DISABLE_REGISTRATION = true; + # }; + # }; + nginx = { enable = false; # TODO: enable this when you want to test all the configs virtualHosts = { @@ -66,20 +102,20 @@ forceSSL = true; enableACME = true; locations."/" = { - proxyPass = - "http://localhost:${toString config.services.headscale.port}"; + proxyPass = "http://localhost:${toString config.services.headscale.port}"; proxyWebsockets = true; }; }; ${jellyfinDomain} = { forceSSL = true; enableACME = true; - locations."/" = { - proxyPass = - "http://localhost:8096"; - proxyWebsockets = true; - }; + locations."/".proxyPass = "http://localhost:8096"; }; + # ${forgejoDomain} = { + # forceSSL = true; + # enableACME = true; + # locations."/".proxyPass = "http://localhost:${toString config.services.forgejo.settings.server.HTTP_PORT}"; + # }; }; }; }; @@ -97,7 +133,7 @@ hybrid-sleep.enable = false; }; - networking.firewall.allowedTCPPorts = [ 2049 ]; + networking.firewall.allowedTCPPorts = [2049]; environment.systemPackages = [ config.services.headscale.package @@ -105,4 +141,4 @@ pkgs.jellyfin-web pkgs.jellyfin-ffmpeg ]; -} \ No newline at end of file +} diff --git a/flake.nix b/flake.nix index 033e2c2..70992b0 100644 --- a/flake.nix +++ b/flake.nix @@ -23,53 +23,57 @@ # repo of hardware configs for prebuilt systems nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - # vscode extensions + # vscode extensions nix-vscode-extensions = { url = "github:nix-community/nix-vscode-extensions"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, disko, nixos-hardware, ... }@inputs: - let - forEachSystem = nixpkgs.lib.genAttrs [ - "aarch64-darwin" - "aarch64-linux" - "x86_64-darwin" - "x86_64-linux" - ]; - forEachPkgs = lambda: forEachSystem (system: lambda nixpkgs.legacyPackages.${system}); - in - { - packages = forEachPkgs (pkgs: import ./pkgs { inherit pkgs; }); + outputs = { + self, + nixpkgs, + disko, + nixos-hardware, + ... + } @ inputs: let + forEachSystem = nixpkgs.lib.genAttrs [ + "aarch64-darwin" + "aarch64-linux" + "x86_64-darwin" + "x86_64-linux" + ]; + forEachPkgs = lambda: forEachSystem (system: lambda nixpkgs.legacyPackages.${system}); + in { + packages = forEachPkgs (pkgs: import ./pkgs {inherit pkgs;}); - nixosConfigurations = { - # Leyla Laptop - horizon = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ - ./hosts/horizon/configuration.nix - inputs.home-manager.nixosModules.default - nixos-hardware.nixosModules.framework-11th-gen-intel - ]; - }; - # Leyla Desktop - twilight = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ - ./hosts/twilight/configuration.nix - inputs.home-manager.nixosModules.default - ]; - }; - # NAS Service - defiant = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ - disko.nixosModules.disko - ./hosts/defiant/disko-config.nix - ./hosts/defiant/configuration.nix - ]; - }; + nixosConfigurations = { + # Leyla Laptop + horizon = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs;}; + modules = [ + ./hosts/horizon/configuration.nix + inputs.home-manager.nixosModules.default + nixos-hardware.nixosModules.framework-11th-gen-intel + ]; + }; + # Leyla Desktop + twilight = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs;}; + modules = [ + ./hosts/twilight/configuration.nix + inputs.home-manager.nixosModules.default + ]; + }; + # NAS Service + defiant = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs;}; + modules = [ + disko.nixosModules.disko + ./hosts/defiant/disko-config.nix + ./hosts/defiant/configuration.nix + ]; }; }; + }; } diff --git a/hosts/defiant/configuration.nix b/hosts/defiant/configuration.nix index d2b1348..42cf19f 100644 --- a/hosts/defiant/configuration.nix +++ b/hosts/defiant/configuration.nix @@ -1,15 +1,18 @@ # server nas -{ config, pkgs, inputs, ... }: { - imports = - [ - inputs.home-manager.nixosModules.default - inputs.sops-nix.nixosModules.sops + config, + pkgs, + inputs, + ... +}: { + imports = [ + inputs.home-manager.nixosModules.default + inputs.sops-nix.nixosModules.sops - ./hardware-configuration.nix - - ../../enviroments/server - ]; + ./hardware-configuration.nix + + ../../enviroments/server + ]; users.leyla.isThinUser = true; @@ -27,7 +30,7 @@ autoScrub.enable = true; autoSnapshot.enable = true; }; - + # temp enable desktop enviroment for setup # Enable the X11 windowing system. xserver = { @@ -43,7 +46,7 @@ }; # Get rid of xTerm - excludePackages = [ pkgs.xterm ]; + excludePackages = [pkgs.xterm]; }; }; @@ -54,4 +57,4 @@ # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "23.05"; # Did you read the comment? -} \ No newline at end of file +} diff --git a/hosts/defiant/disko-config.nix b/hosts/defiant/disko-config.nix index 653f29f..a913aeb 100644 --- a/hosts/defiant/disko-config.nix +++ b/hosts/defiant/disko-config.nix @@ -1,11 +1,10 @@ -{ lib, ... }: -let +{lib, ...}: let bootDisk = devicePath: { type = "disk"; device = devicePath; content = { type = "gpt"; - + partitions = { boot = { size = "1M"; @@ -86,11 +85,13 @@ in { # should this only mirror for this inital config with 3 drives we will used raidz2 for future configs??? mode = "mirror"; members = [ - "hd_13_tb_a" "hd_13_tb_b" "hd_13_tb_c" + "hd_13_tb_a" + "hd_13_tb_b" + "hd_13_tb_c" ]; } ]; - cache = [ ]; + cache = []; # cache = [ "ssd_2_tb_a" ]; }; }; @@ -98,7 +99,7 @@ in { options = { ashift = "12"; }; - + rootFsOptions = { encryption = "on"; keyformat = "hex"; @@ -111,7 +112,7 @@ in { mountpoint = "/"; postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank"; - + datasets = { "nix" = { type = "zfs_fs"; @@ -133,4 +134,3 @@ in { }; }; } - diff --git a/hosts/defiant/hardware-configuration.nix b/hosts/defiant/hardware-configuration.nix index 60e940b..219b6a5 100644 --- a/hosts/defiant/hardware-configuration.nix +++ b/hosts/defiant/hardware-configuration.nix @@ -1,9 +1,13 @@ # 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, ... }: - { + config, + lib, + pkgs, + modulesPath, + ... +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ../hardware-common.nix @@ -11,15 +15,15 @@ boot = { initrd = { - availableKernelModules = [ "xhci_pci" "aacraid" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - kernelModules = [ ]; + availableKernelModules = ["xhci_pci" "aacraid" "ahci" "usbhid" "usb_storage" "sd_mod"]; + kernelModules = []; }; - kernelModules = [ "kvm-amd" ]; - extraModulePackages = [ ]; - - supportedFilesystems = [ "zfs" ]; + kernelModules = ["kvm-amd"]; + extraModulePackages = []; - zfs.extraPools = [ "zroot" ]; + supportedFilesystems = ["zfs"]; + + zfs.extraPools = ["zroot"]; }; # fileSystems."/" = @@ -27,7 +31,7 @@ # fsType = "ext4"; # }; - swapDevices = [ ]; + swapDevices = []; networking = { # Enables DHCP on each ethernet and wireless interface. In case of scripted networking @@ -46,4 +50,4 @@ # TODO: hardware graphics cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }; -} \ No newline at end of file +} diff --git a/hosts/hardware-common.nix b/hosts/hardware-common.nix index dea9450..920d609 100644 --- a/hosts/hardware-common.nix +++ b/hosts/hardware-common.nix @@ -1,5 +1,4 @@ -{ lib, ... }: -{ +{lib, ...}: { options = { hardware = { piperMouse = { @@ -13,4 +12,4 @@ }; }; }; -} \ No newline at end of file +} diff --git a/hosts/horizon/configuration.nix b/hosts/horizon/configuration.nix index f1c3bee..1bd5bfc 100644 --- a/hosts/horizon/configuration.nix +++ b/hosts/horizon/configuration.nix @@ -1,15 +1,18 @@ # leyla laptop -{ config, pkgs, inputs, ... }: { - imports = - [ - inputs.home-manager.nixosModules.default - inputs.sops-nix.nixosModules.sops + config, + pkgs, + inputs, + ... +}: { + imports = [ + inputs.home-manager.nixosModules.default + inputs.sops-nix.nixosModules.sops - ./hardware-configuration.nix - - ../../enviroments/client - ]; + ./hardware-configuration.nix + + ../../enviroments/client + ]; users = { leyla.isFullUser = true; @@ -25,7 +28,7 @@ setSocketVariable = true; }; }; - users.extraGroups.docker.members = [ "leyla" ]; + users.extraGroups.docker.members = ["leyla"]; # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; diff --git a/hosts/horizon/hardware-configuration.nix b/hosts/horizon/hardware-configuration.nix index 82e1bf7..1e203f3 100644 --- a/hosts/horizon/hardware-configuration.nix +++ b/hosts/horizon/hardware-configuration.nix @@ -1,9 +1,13 @@ # 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, ... }: - { + config, + lib, + pkgs, + modulesPath, + ... +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ../hardware-common.nix @@ -11,12 +15,12 @@ boot = { initrd = { - availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; - kernelModules = [ ]; + availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"]; + kernelModules = []; }; - kernelModules = [ "kvm-intel" "sg" ]; - extraModulePackages = [ ]; - + kernelModules = ["kvm-intel" "sg"]; + extraModulePackages = []; + # Bootloader. loader = { systemd-boot.enable = true; @@ -25,43 +29,39 @@ }; fileSystems = { - "/" = - { device = "/dev/disk/by-uuid/866d422b-f816-4ad9-9846-791839cb9337"; - fsType = "ext4"; - }; + "/" = { + device = "/dev/disk/by-uuid/866d422b-f816-4ad9-9846-791839cb9337"; + fsType = "ext4"; + }; - "/boot" = - { device = "/dev/disk/by-uuid/E138-65B5"; - fsType = "vfat"; - }; + "/boot" = { + device = "/dev/disk/by-uuid/E138-65B5"; + fsType = "vfat"; + }; - "/mnt/leyla_home" = - { - device = "defiant:/home/leyla"; - fsType = "nfs"; - options = [ "x-systemd.automount" "user" "noatime" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc" ]; - }; + "/mnt/leyla_home" = { + device = "defiant:/home/leyla"; + fsType = "nfs"; + options = ["x-systemd.automount" "user" "noatime" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"]; + }; - "/mnt/eve_home" = - { - device = "defiant:/home/eve"; - fsType = "nfs"; - options = [ "x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc" ]; - }; + "/mnt/eve_home" = { + device = "defiant:/home/eve"; + fsType = "nfs"; + options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"]; + }; - "/mnt/ester_home" = - { - device = "defiant:/home/ester"; - fsType = "nfs"; - options = [ "x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc" ]; - }; + "/mnt/ester_home" = { + device = "defiant:/home/ester"; + fsType = "nfs"; + options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"]; + }; - "/mnt/users_home" = - { - device = "defiant:/home/users"; - fsType = "nfs"; - options = [ "x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc" ]; - }; + "/mnt/users_home" = { + device = "defiant:/home/users"; + fsType = "nfs"; + options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"]; + }; # "/mnt/legacy_leyla_home" = # { @@ -87,9 +87,9 @@ services.cachefilesd.enable = true; - swapDevices = - [ { device = "/dev/disk/by-uuid/be98e952-a072-4c3a-8c12-69500b5a2fff"; } - ]; + swapDevices = [ + {device = "/dev/disk/by-uuid/be98e952-a072-4c3a-8c12-69500b5a2fff";} + ]; networking = { useDHCP = lib.mkDefault true; @@ -99,7 +99,6 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware = { graphics.enable = true; cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/hosts/twilight/configuration.nix b/hosts/twilight/configuration.nix index 727f028..991ecbc 100644 --- a/hosts/twilight/configuration.nix +++ b/hosts/twilight/configuration.nix @@ -1,15 +1,18 @@ # leyla laptop -{ config, pkgs, inputs, ... }: { - imports = - [ - inputs.home-manager.nixosModules.default - inputs.sops-nix.nixosModules.sops + config, + pkgs, + inputs, + ... +}: { + imports = [ + inputs.home-manager.nixosModules.default + inputs.sops-nix.nixosModules.sops - ./hardware-configuration.nix - - ../../enviroments/client - ]; + ./hardware-configuration.nix + + ../../enviroments/client + ]; users = { leyla = { @@ -19,7 +22,7 @@ ester.isFullUser = true; eve.isFullUser = true; }; - + # enabled virtualisation for docker # virtualisation.docker.enable = true; diff --git a/hosts/twilight/hardware-configuration.nix b/hosts/twilight/hardware-configuration.nix index 0f77e81..b2f11ee 100644 --- a/hosts/twilight/hardware-configuration.nix +++ b/hosts/twilight/hardware-configuration.nix @@ -1,9 +1,13 @@ # 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, ... }: - { + config, + lib, + pkgs, + modulesPath, + ... +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ../hardware-common.nix @@ -11,11 +15,11 @@ boot = { initrd = { - availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - kernelModules = [ ]; + availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; + kernelModules = []; }; - kernelModules = [ "kvm-amd" "sg" ]; - extraModulePackages = [ ]; + kernelModules = ["kvm-amd" "sg"]; + extraModulePackages = []; # Bootloader. loader = { @@ -33,40 +37,37 @@ }; fileSystems = { - "/" = - { device = "/dev/disk/by-uuid/8be49c65-2b57-48f1-b74d-244d26061adb"; - fsType = "ext4"; - }; + "/" = { + device = "/dev/disk/by-uuid/8be49c65-2b57-48f1-b74d-244d26061adb"; + fsType = "ext4"; + }; - "/boot" = - { device = "/dev/disk/by-uuid/3006-3867"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - "/mnt/leyla_home" = - { - device = "server.arpa:/home/leyla"; - fsType = "nfs"; - options = [ "x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc" ]; - }; + "/boot" = { + device = "/dev/disk/by-uuid/3006-3867"; + fsType = "vfat"; + options = ["fmask=0022" "dmask=0022"]; + }; - "/mnt/share_home" = - { - device = "server.arpa:/home/share"; - fsType = "nfs"; - options = [ "x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc" ]; - }; + "/mnt/leyla_home" = { + device = "server.arpa:/home/leyla"; + fsType = "nfs"; + options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"]; + }; - "/mnt/docker_home" = - { - device = "server.arpa:/home/docker"; - fsType = "nfs"; - options = [ "x-systemd.automount" "noauto" "x-systemd.idle-timeout=600" ]; - }; + "/mnt/share_home" = { + device = "server.arpa:/home/share"; + fsType = "nfs"; + options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"]; + }; + + "/mnt/docker_home" = { + device = "server.arpa:/home/docker"; + fsType = "nfs"; + options = ["x-systemd.automount" "noauto" "x-systemd.idle-timeout=600"]; + }; }; - swapDevices = [ ]; + swapDevices = []; networking = { # Enables DHCP on each ethernet and wireless interface. In case of scripted networking @@ -86,7 +87,7 @@ # Enable OpenGL graphics.enable = true; - + # install graphics drivers nvidia = { # Modesetting is required. @@ -94,7 +95,7 @@ # Nvidia power management. Experimental, and can cause sleep/suspend to fail. # Enable this if you have graphical corruption issues or application crashes after waking - # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead # of just the bare essentials. powerManagement.enable = false; @@ -104,15 +105,15 @@ # Use the NVidia open source kernel module (not to be confused with the # independent third-party "nouveau" open source driver). - # Support is limited to the Turing and later architectures. Full list of - # supported GPUs is at: - # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus + # Support is limited to the Turing and later architectures. Full list of + # supported GPUs is at: + # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus # Only available from driver 515.43.04+ # Currently alpha-quality/buggy, so false is currently the recommended setting. open = false; # Enable the Nvidia settings menu, - # accessible via `nvidia-settings`. + # accessible via `nvidia-settings`. nvidiaSettings = true; # Optionally, you may need to select the appropriate driver version for your specific GPU. @@ -122,4 +123,3 @@ cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }; } - diff --git a/overlays/intellij.nix b/overlays/intellij.nix index d83bd15..c907588 100644 --- a/overlays/intellij.nix +++ b/overlays/intellij.nix @@ -1,5 +1,4 @@ -_: -{ +_: { # nixpkgs.overlays = [ # (self: super: { # # idea is too out of date for android gradle things @@ -16,4 +15,4 @@ _: # }; # }) # ]; -} \ No newline at end of file +} diff --git a/overlays/vscodium.nix b/overlays/vscodium.nix index 618af19..7c5f863 100644 --- a/overlays/vscodium.nix +++ b/overlays/vscodium.nix @@ -1,5 +1,4 @@ -_: -{ +_: { # nixpkgs.overlays = [ # (self: super: { # # ui is broken on 1.84 @@ -12,4 +11,4 @@ _: # }); # }) # ]; -} \ No newline at end of file +} diff --git a/pkgs/default.nix b/pkgs/default.nix index fbc54ee..87a13d7 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,2 @@ -_: -{ - -} \ No newline at end of file +_: { +} diff --git a/templates/default.nix b/templates/default.nix index f9d63b0..eed7124 100644 --- a/templates/default.nix +++ b/templates/default.nix @@ -1,2 +1 @@ -_: -{} \ No newline at end of file +_: {} diff --git a/users/default.nix b/users/default.nix index 57effe3..4c0b5d7 100644 --- a/users/default.nix +++ b/users/default.nix @@ -1,8 +1,7 @@ -{ inputs, ... }: -{ - imports = [ ./leyla ./ester ./eve ]; +{inputs, ...}: { + imports = [./leyla ./ester ./eve]; users.mutableUsers = false; - home-manager.extraSpecialArgs = { inherit inputs; }; -} \ No newline at end of file + home-manager.extraSpecialArgs = {inherit inputs;}; +} diff --git a/users/ester/default.nix b/users/ester/default.nix index 156716f..a16b69b 100644 --- a/users/ester/default.nix +++ b/users/ester/default.nix @@ -1,8 +1,11 @@ -{ lib, config, pkgs, ... }: -let - cfg = config.users.ester; -in { + lib, + config, + pkgs, + ... +}: let + cfg = config.users.ester; +in { options.users.ester = { isFullUser = lib.mkEnableOption "ester"; }; @@ -25,9 +28,10 @@ in } ( - if cfg.isFullUser then { + if cfg.isFullUser + then { isNormalUser = true; - extraGroups = [ "networkmanager" "users" ]; + extraGroups = ["networkmanager" "users"]; hashedPasswordFile = config.sops.secrets."passwords/ester".path; @@ -36,10 +40,11 @@ in bitwarden discord ]; - } else { + } + else { isSystemUser = true; } ) ]; }; -} \ No newline at end of file +} diff --git a/users/eve/default.nix b/users/eve/default.nix index 4ed06a8..8ad6b61 100644 --- a/users/eve/default.nix +++ b/users/eve/default.nix @@ -1,8 +1,11 @@ -{ lib, config, pkgs, ... }: -let - cfg = config.users.eve; -in { + lib, + config, + pkgs, + ... +}: let + cfg = config.users.eve; +in { options.users.eve = { isFullUser = lib.mkEnableOption "eve"; }; @@ -25,9 +28,10 @@ in } ( - if cfg.isFullUser then { + if cfg.isFullUser + then { isNormalUser = true; - extraGroups = [ "networkmanager" "users" ]; + extraGroups = ["networkmanager" "users"]; hashedPasswordFile = config.sops.secrets."passwords/eve".path; @@ -38,10 +42,11 @@ in makemkv signal-desktop ]; - } else { + } + else { isSystemUser = true; } ) ]; }; -} \ No newline at end of file +} diff --git a/users/leyla/default.nix b/users/leyla/default.nix index 42fd3ab..9454c2d 100644 --- a/users/leyla/default.nix +++ b/users/leyla/default.nix @@ -1,9 +1,12 @@ -{ lib, config, pkgs, ... }: -let - cfg = config.users.leyla; -in { - imports =[ + lib, + config, + pkgs, + ... +}: let + cfg = config.users.leyla; +in { + imports = [ ./packages.nix ]; @@ -31,12 +34,13 @@ in } ( - if (cfg.isFullUser || cfg.isThinUser) then { + if (cfg.isFullUser || cfg.isThinUser) + then { isNormalUser = true; extraGroups = lib.mkMerge [ ["networkmanager" "wheel" "users"] ( - lib.mkIf (!cfg.isThinUser) [ "adbusers" ] + lib.mkIf (!cfg.isThinUser) ["adbusers"] ) ]; @@ -48,7 +52,8 @@ in "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKBiZkg1c2aaNHiieBX4cEziqvJVj9pcDfzUrKU/mO0I leyla@twilight" ]; }; - } else { + } + else { isSystemUser = true; } ) @@ -66,4 +71,4 @@ in home-manager.users.leyla = lib.mkIf (cfg.isFullUser || cfg.isThinUser) (import ./home.nix); }; -} \ No newline at end of file +} diff --git a/users/leyla/home.nix b/users/leyla/home.nix index 40a6926..fdca257 100644 --- a/users/leyla/home.nix +++ b/users/leyla/home.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { # Home Manager needs a bit of information about you and the paths it should # manage. home = { @@ -73,11 +75,11 @@ }; programs = { - # Let Home Manager install and manage itself. + # Let Home Manager install and manage itself. home-manager.enable = true; git = { enable = true; - userName = "Leyla Becker"; + userName = "Leyla Becker"; userEmail = "git@jan-leila.com"; extraConfig.init.defaultBranch = "main"; }; @@ -89,18 +91,18 @@ "org/gnome/desktop/interface".color-scheme = "prefer-dark"; "org/gnome/shell" = { - disable-user-extensions = false; # enables user extensions - enabled-extensions = [ - # Put UUIDs of extensions that you want to enable here. - # If the extension you want to enable is packaged in nixpkgs, - # you can easily get its UUID by accessing its extensionUuid - # field (look at the following example). - pkgs.gnomeExtensions.dash-to-dock.extensionUuid - - # Alternatively, you can manually pass UUID as a string. - # "dash-to-dock@micxgx.gmail.com" - ]; - }; + disable-user-extensions = false; # enables user extensions + enabled-extensions = [ + # Put UUIDs of extensions that you want to enable here. + # If the extension you want to enable is packaged in nixpkgs, + # you can easily get its UUID by accessing its extensionUuid + # field (look at the following example). + pkgs.gnomeExtensions.dash-to-dock.extensionUuid + + # Alternatively, you can manually pass UUID as a string. + # "dash-to-dock@micxgx.gmail.com" + ]; + }; "org/gnome/shell/extensions/dash-to-dock" = { "dock-position" = "LEFT"; diff --git a/users/leyla/packages.nix b/users/leyla/packages.nix index 756593a..e206d22 100644 --- a/users/leyla/packages.nix +++ b/users/leyla/packages.nix @@ -1,8 +1,12 @@ -{ lib, config, pkgs, inputs, ... }: -let - cfg = config.users.leyla; -in { + lib, + config, + pkgs, + inputs, + ... +}: let + cfg = config.users.leyla; +in { imports = [ ../../overlays/intellij.nix ../../overlays/vscodium.nix @@ -70,41 +74,43 @@ in obsidian steam (lib.mkIf cfg.hasGPU davinci-resolve) - + # development tools (vscode-with-extensions.override { vscode = vscodium; - vscodeExtensions = with open-vsx; [ - # vs code feel extensions - ms-vscode.atom-keybindings - akamud.vscode-theme-onedark - streetsidesoftware.code-spell-checker - streetsidesoftware.code-spell-checker-german - streetsidesoftware.code-spell-checker-italian - jeanp413.open-remote-ssh + vscodeExtensions = with open-vsx; + [ + # vs code feel extensions + ms-vscode.atom-keybindings + akamud.vscode-theme-onedark + streetsidesoftware.code-spell-checker + streetsidesoftware.code-spell-checker-german + streetsidesoftware.code-spell-checker-italian + jeanp413.open-remote-ssh - # nix extensions - pinage404.nix-extension-pack - jnoortheen.nix-ide + # nix extensions + pinage404.nix-extension-pack + jnoortheen.nix-ide - # html extensions - formulahendry.auto-rename-tag - ms-vscode.live-server - - # js extensions - dsznajder.es7-react-js-snippets - dbaeumer.vscode-eslint - standard.vscode-standard - firsttris.vscode-jest-runner - stylelint.vscode-stylelint - tauri-apps.tauri-vscode + # html extensions + formulahendry.auto-rename-tag + ms-vscode.live-server - # misc extensions - bungcip.better-toml - ] ++ (with vscode-marketplace; [ - # js extensions - karyfoundation.nearley - ]); + # js extensions + dsznajder.es7-react-js-snippets + dbaeumer.vscode-eslint + standard.vscode-standard + firsttris.vscode-jest-runner + stylelint.vscode-stylelint + tauri-apps.tauri-vscode + + # misc extensions + bungcip.better-toml + ] + ++ (with vscode-marketplace; [ + # js extensions + karyfoundation.nearley + ]); }) androidStudioPackages.canary jetbrains.idea-community @@ -126,4 +132,4 @@ in ) ] ); -} \ No newline at end of file +} diff --git a/util/default.nix b/util/default.nix index a4fab1e..acd1997 100644 --- a/util/default.nix +++ b/util/default.nix @@ -1,8 +1,7 @@ -_: -{ +_: { # mkUnless = condition: then: (mkIf (!condition) then); # mkIfElse = condition: then: else: lib.mkMerge [ # (mkIf condition then) # (mkUnless condition else) # ]; -} \ No newline at end of file +}