diff --git a/desktop/default.nix b/desktop/default.nix index c92657d..18b9ce1 100644 --- a/desktop/default.nix +++ b/desktop/default.nix @@ -1,9 +1,5 @@ { config, pkgs, ... }: { - imports = [ - ./x11.nix - ./gtk.nix - ./gnome.nix - ]; + imports = [ ./x11.nix ./gtk.nix ./gnome.nix ]; } diff --git a/desktop/gnome.nix b/desktop/gnome.nix index 802a1f3..7622d8f 100644 --- a/desktop/gnome.nix +++ b/desktop/gnome.nix @@ -19,16 +19,16 @@ let # the gschema doesn't seem to be installed properly (see dconf) makeFlags = [ "INSTALLBASE=$(out)/share/gnome-shell/extensions" ]; }; -in -{ - environment.systemPackages = with pkgs; with gnomeExtensions; [ - gnome3.dconf-editor - gnome3.gnome-tweaks - gnome3.gnome-shell-extensions # required for user-theme - dash-to-panel - appindicator - pop-shell - ]; +in { + environment.systemPackages = with pkgs; + with gnomeExtensions; [ + gnome3.dconf-editor + gnome3.gnome-tweaks + gnome3.gnome-shell-extensions # required for user-theme + dash-to-panel + appindicator + pop-shell + ]; services.xserver.displayManager.gdm.enable = true; services.xserver.displayManager.gdm.wayland = false; diff --git a/flake.nix b/flake.nix index 8d75354..f28728a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,38 +1,32 @@ { inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - inputs.home-manager = { - url = "github:nix-community/home-manager/master"; - }; + inputs.home-manager = { url = "github:nix-community/home-manager/master"; }; inputs.nur.url = "github:nix-community/NUR/master"; - outputs = { self, nixpkgs, home-manager, nur }: let - systemModule = { hostName, hardwareConfig, config }: ({ pkgs, ... }: { - networking.hostName = hostName; + outputs = { self, nixpkgs, home-manager, nur }: + let + systemModule = { hostName, hardwareConfig, config }: + ({ pkgs, ... }: { + networking.hostName = hostName; - # Let 'nixos-version --json' know about the Git revision - # of this flake. - system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; + # Let 'nixos-version --json' know about the Git revision + # of this flake. + system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; - nix.registry.nixpkgs.flake = nixpkgs; + nix.registry.nixpkgs.flake = nixpkgs; - nixpkgs.overlays = [ - nur.overlay - ]; + nixpkgs.overlays = [ nur.overlay ]; - imports = [ - hardwareConfig - home-manager.nixosModules.home-manager - config - ]; - }); - in { + imports = + [ hardwareConfig home-manager.nixosModules.home-manager config ]; + }); + in { - nixosConfigurations.felix-nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = - [ + nixosConfigurations.felix-nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ nixpkgs.nixosModules.notDetected (systemModule { hostName = "felix-nixos"; @@ -40,12 +34,11 @@ config = ./home-pc.nix; }) ]; - }; + }; - nixosConfigurations.pilot1 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = - [ + nixosConfigurations.pilot1 = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ nixpkgs.nixosModules.notDetected (systemModule { hostName = "pilot1"; @@ -53,9 +46,9 @@ config = ./work-pc.nix; }) ]; + }; + + homeManagerModules.git = import ./home/modules/git.nix; + }; - - homeManagerModules.git = import ./home/modules/git.nix; - - }; } diff --git a/hardware/base.nix b/hardware/base.nix index 6772415..f6d9e5a 100644 --- a/hardware/base.nix +++ b/hardware/base.nix @@ -1,9 +1,7 @@ { config, pkgs, ... }: { - imports = [ - ./planck.nix - ]; + imports = [ ./planck.nix ]; boot.supportedFilesystems = [ "btrfs" ]; boot.kernelPackages = pkgs.linuxPackages_latest; @@ -16,9 +14,7 @@ # Bluetooth hardware.bluetooth.enable = true; hardware.bluetooth.config = { - General = { - Enable = "Source,Sink,Media,Socket"; - }; + General = { Enable = "Source,Sink,Media,Socket"; }; }; # Sound. diff --git a/hardware/felix-nixos.nix b/hardware/felix-nixos.nix index 081a985..4d6e992 100644 --- a/hardware/felix-nixos.nix +++ b/hardware/felix-nixos.nix @@ -1,42 +1,44 @@ { config, lib, pkgs, ... }: { - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = + [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6"; - fsType = "btrfs"; - options = [ "subvol=@" "compress-force=zstd" "noatime" ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6"; + fsType = "btrfs"; + options = [ "subvol=@" "compress-force=zstd" "noatime" ]; + }; - boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/6f4f3ce1-57fd-4ec3-bb9d-7847853d2dcf"; + boot.initrd.luks.devices."enc".device = + "/dev/disk/by-uuid/6f4f3ce1-57fd-4ec3-bb9d-7847853d2dcf"; - fileSystems."/home" = - { device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6"; - fsType = "btrfs"; - options = [ "subvol=@home" "compress-force=zstd" "noatime" ]; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6"; + fsType = "btrfs"; + options = [ "subvol=@home" "compress-force=zstd" "noatime" ]; + }; - fileSystems."/swap" = - { device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6"; - fsType = "btrfs"; - options = [ "subvol=@swap" ]; - neededForBoot = true; - }; + fileSystems."/swap" = { + device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6"; + fsType = "btrfs"; + options = [ "subvol=@swap" ]; + neededForBoot = true; + }; - fileSystems."/.snapshots" = - { device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6"; - fsType = "btrfs"; - options = [ "subvol=@snapshots" "compress-force=zstd" "noatime" ]; - }; + fileSystems."/.snapshots" = { + device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6"; + fsType = "btrfs"; + options = [ "subvol=@snapshots" "compress-force=zstd" "noatime" ]; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/5C20-4516"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/5C20-4516"; + fsType = "vfat"; + }; swapDevices = [ ]; diff --git a/hardware/gpu-bumblebee.nix b/hardware/gpu-bumblebee.nix index eb92e8c..016f00b 100644 --- a/hardware/gpu-bumblebee.nix +++ b/hardware/gpu-bumblebee.nix @@ -6,10 +6,6 @@ hardware.opengl = { driSupport32Bit = true; - extraPackages = with pkgs; [ - vaapiIntel - vaapiVdpau - libvdpau-va-gl - ]; + extraPackages = with pkgs; [ vaapiIntel vaapiVdpau libvdpau-va-gl ]; }; } diff --git a/hardware/gpu-nvidia.nix b/hardware/gpu-nvidia.nix index 5f8898f..81b7719 100644 --- a/hardware/gpu-nvidia.nix +++ b/hardware/gpu-nvidia.nix @@ -9,9 +9,6 @@ hardware.opengl = { driSupport32Bit = true; - extraPackages = with pkgs; [ - libvdpau-va-gl - vaapiVdpau - ]; + extraPackages = with pkgs; [ libvdpau-va-gl vaapiVdpau ]; }; } diff --git a/home-pc.nix b/home-pc.nix index 2fafa3c..5f8e1ff 100644 --- a/home-pc.nix +++ b/home-pc.nix @@ -11,7 +11,7 @@ ./services/jellyfin.nix ]; - swapDevices = [ { device = "/swap/swapfile"; } ]; + swapDevices = [{ device = "/swap/swapfile"; }]; nixpkgs.config.allowUnfree = true; diff --git a/home/felschr-work.nix b/home/felschr-work.nix index d64ee4a..42467d1 100644 --- a/home/felschr-work.nix +++ b/home/felschr-work.nix @@ -1,7 +1,6 @@ { config, pkgs, ... }: -with pkgs; -{ +with pkgs; { imports = [ ./shell ./editors @@ -20,9 +19,7 @@ with pkgs; longitude = "10.4021562"; }; - programs.ssh = { - enable = true; - }; + programs.ssh = { enable = true; }; services.gpg-agent = { enable = true; @@ -35,9 +32,7 @@ with pkgs; programs.gpg.enable = true; - programs.git = { - defaultProfile = "work"; - }; + programs.git = { defaultProfile = "work"; }; xdg.configFile."nixpkgs/config.nix".text = '' { diff --git a/home/felschr.nix b/home/felschr.nix index 657168b..9479570 100644 --- a/home/felschr.nix +++ b/home/felschr.nix @@ -24,9 +24,7 @@ }; }; - programs.ssh = { - enable = true; - }; + programs.ssh = { enable = true; }; services.gpg-agent = { enable = true; @@ -39,9 +37,7 @@ programs.gpg.enable = true; - programs.git = { - defaultProfile = "private"; - }; + programs.git = { defaultProfile = "private"; }; xdg.configFile."nixpkgs/config.nix".text = '' { diff --git a/home/git.nix b/home/git.nix index 0d2271e..7f1ba19 100644 --- a/home/git.nix +++ b/home/git.nix @@ -1,38 +1,30 @@ { config, pkgs, ... }: { - imports = [ - ./modules/git.nix - ]; + imports = [ ./modules/git.nix ]; programs.git = { enable = true; profiles = { private = { - name = "Felix Tenley"; - email = "dev@felschr.com"; + name = "Felix Tenley"; + email = "dev@felschr.com"; signingKey = "6AB3 7A28 5420 9A41 82D9 0068 910A CB9F 6BD2 6F58"; - dirs = [ "~/dev/private/" "/etc/nixos" ]; + dirs = [ "~/dev/private/" "/etc/nixos" ]; }; work = { - name = "Felix Schröter"; - email = "fs@upsquared.com"; + name = "Felix Schröter"; + email = "fs@upsquared.com"; signingKey = "F28B FB74 4421 7580 5A49 2930 BE85 F0D9 987F A014"; - dirs = [ "~/dev/work/" ]; + dirs = [ "~/dev/work/" ]; }; }; - ignores = [".direnv"]; - signing = { - signByDefault = true; - }; + ignores = [ ".direnv" ]; + signing = { signByDefault = true; }; extraConfig = { - init = { - defaultBranch = "main"; - }; - pull = { - rebase = true; - }; + init = { defaultBranch = "main"; }; + pull = { rebase = true; }; rebase = { autoStash = true; autoSquash = true; @@ -41,8 +33,10 @@ }; }; aliases = { - mr = "!sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -"; - pr = "!sh -c 'git fetch $1 refs/pull/$2/head:pr/$1 && git checkout pr/$2'"; + mr = + "!sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -"; + pr = + "!sh -c 'git fetch $1 refs/pull/$2/head:pr/$1 && git checkout pr/$2'"; }; }; } diff --git a/home/keybase.nix b/home/keybase.nix index 3e7f914..c577a49 100644 --- a/home/keybase.nix +++ b/home/keybase.nix @@ -7,7 +7,7 @@ home.packages = [ pkgs.keybase-gui ]; xdg.configFile."autostart/keybase.desktop".text = with pkgs; - builtins.replaceStrings - ["${keybase-gui}"] ["env KEYBASE_AUTOSTART=1 ${keybase-gui}"] - (builtins.readFile "${keybase-gui}/share/applications/keybase.desktop"); + builtins.replaceStrings [ "${keybase-gui}" ] + [ "env KEYBASE_AUTOSTART=1 ${keybase-gui}" ] + (builtins.readFile "${keybase-gui}/share/applications/keybase.desktop"); } diff --git a/home/planck.nix b/home/planck.nix index 6278c6e..06981a4 100644 --- a/home/planck.nix +++ b/home/planck.nix @@ -1,8 +1,5 @@ { config, pkgs, ... }: -with pkgs; -{ - home.packages = [ - wally-cli - ]; +with pkgs; { + home.packages = [ wally-cli ]; } diff --git a/home/signal.nix b/home/signal.nix index 101390f..be60bbc 100644 --- a/home/signal.nix +++ b/home/signal.nix @@ -2,23 +2,21 @@ with pkgs; let - signal-desktop = runCommand "signal-desktop" { - buildInputs = [ makeWrapper ]; - } '' - mkdir $out - ln -s ${pkgs.signal-desktop}/* $out - rm $out/bin - makeWrapper ${pkgs.signal-desktop}/bin/signal-desktop $out/bin/signal-desktop \ - --add-flags "--use-tray-icon" - ''; -in -{ + signal-desktop = + runCommand "signal-desktop" { buildInputs = [ makeWrapper ]; } '' + mkdir $out + ln -s ${pkgs.signal-desktop}/* $out + rm $out/bin + makeWrapper ${pkgs.signal-desktop}/bin/signal-desktop $out/bin/signal-desktop \ + --add-flags "--use-tray-icon" + ''; +in { home.packages = [ signal-desktop ]; # TODO switch to overwritten `signal-desktop` when # desktop file is updated with correct exec path xdg.configFile."autostart/signal-desktop.desktop".text = - builtins.replaceStrings - ["bin/signal-desktop"] ["bin/signal-desktop --start-in-tray"] - (builtins.readFile "${pkgs.signal-desktop}/share/applications/signal-desktop.desktop"); + builtins.replaceStrings [ "bin/signal-desktop" ] + [ "bin/signal-desktop --start-in-tray" ] (builtins.readFile + "${pkgs.signal-desktop}/share/applications/signal-desktop.desktop"); } diff --git a/home/vpn.nix b/home/vpn.nix index 9f177d3..b3991ab 100644 --- a/home/vpn.nix +++ b/home/vpn.nix @@ -1,10 +1,7 @@ { config, pkgs, ... }: -with pkgs; -{ - home.packages = with pkgs; [ - mullvad-vpn - ]; +with pkgs; { + home.packages = with pkgs; [ mullvad-vpn ]; # autostart xdg.configFile."autostart/mullvad-vpn.desktop".source = diff --git a/system/default.nix b/system/default.nix index 2d30faa..ff737b7 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,18 +1,9 @@ { config, pkgs, ... }: { - imports = [ - ./hardened.nix - ./i18n.nix - ./nix.nix - ./vpn.nix - ]; + imports = [ ./hardened.nix ./i18n.nix ./nix.nix ./vpn.nix ]; - environment.systemPackages = with pkgs; [ - wget - curl - neovim - ]; + environment.systemPackages = with pkgs; [ wget curl neovim ]; fonts.fonts = with pkgs; [ fira-code diff --git a/system/hardened.nix b/system/hardened.nix index 920ad9d..e2706a0 100644 --- a/system/hardened.nix +++ b/system/hardened.nix @@ -2,8 +2,7 @@ # utilises some of the measures from # -with lib; -{ +with lib; { boot.loader.systemd-boot.editor = mkDefault false; nix.allowedUsers = mkDefault [ "@users" ]; diff --git a/templates/dotnet.nix b/templates/dotnet.nix index c883c4e..2a88bd1 100644 --- a/templates/dotnet.nix +++ b/templates/dotnet.nix @@ -2,15 +2,27 @@ with pkgs; let - dotnet-combined = with dotnetCorePackages; combinePackages [ sdk_3_1 sdk_2_1 ]; + # preview + # buildDotnet = attrs: callPackage (import attrs) {}; + # buildAspNetCore = attrs: buildDotnet (attrs // { type = "aspnetcore"; }); + # buildNetCore = attrs: buildDotnet (attrs // { type = "netcore"; }); + # buildNetCoreSdk = attrs: buildDotnet (attrs // { type = "sdk"; }); + + # sdk_5_0_rc_1 = buildNetCoreSdk { + # version = "5.0.100-rc.1.20452.10"; + # sha512 = { + # x86_64-linux = "d7e709dacc4bb188c2380060d24bfb5b791240dc33af8499fb4a31e1885a9377dad1d1ebc76847432ea67d5e4ac832a31679dc293e09fa6dade28f5fbbe4db9b"; + # aarch64-linux = "2d04890c71e845d1eb08f5dfbbb9c93024d7a52fb1cc3fd50bd51bc6bd44e455c5c82abc8f04eef23bd012984ae5f86143c600ceb49c4c733935d95d5b68785f"; + # x86_64-darwin = "06bb40273071f3dd1e84ebf58abc7798795d5f1ac298f24bf7109d1597fd52ff31bcbf2b81f86d91d37ae293678d07f8da0469d7cbd318d19a8d718b6629dcac"; + # }; + # }; + + dotnet-combined = with dotnetCorePackages; combinePackages [ sdk_3_1 ]; dotnetRoot = "${dotnet-combined}"; dotnetSdk = "${dotnet-combined}/sdk"; dotnetBinary = "${dotnetRoot}/bin/dotnet"; -in -{ - home.packages = [ - dotnet-combined - ]; +in { + home.packages = [ dotnet-combined ]; home.sessionVariables = { DOTNET_ROOT = dotnetRoot; diff --git a/virtualisation/docker.nix b/virtualisation/docker.nix index eb10783..78454d2 100644 --- a/virtualisation/docker.nix +++ b/virtualisation/docker.nix @@ -1,9 +1,7 @@ { config, pkgs, ... }: { - environment.systemPackages = with pkgs; [ - docker-compose - ]; + environment.systemPackages = with pkgs; [ docker-compose ]; virtualisation.docker = { enable = true;