diff --git a/SwarselSystems.org b/SwarselSystems.org index a345bb3..29b4fcf 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -1149,41 +1149,37 @@ My work machine. Built for more security, this is the gold standard of my config #+begin_src nix :tangle profiles/nbm-imba-166/default.nix - { inputs, outputs, config, ... }: + { self, inputs, outputs, ... }: + let + profilesPath = "${self}/profiles"; + in { - imports = [ + "${profilesPath}/darwin/common/nixos" + inputs.home-manager.darwinModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; home-manager.users."leon.schwarzaeugl".imports = [ + "${profilesPath}/darwin/common/home" ] ++ (builtins.attrValues outputs.homeManagerModules); } ] ++ (builtins.attrValues outputs.nixosModules); - nix.settings.experimental-features = "nix-command flakes"; - nixpkgs = { - hostPlatform = "x86_64-darwin"; - inherit (outputs) overlays; - config = { - allowUnfree = true; - }; - }; # Auto upgrade nix package and the daemon service. services.nix-daemon.enable = true; services.karabiner-elements.enable = true; - home-manager.users."leon.schwarzaeugl".home.stateVersion = "23.05"; - home-manager.users."leon.schwarzaeugl".swarselsystems = { - isDarwin = true; - isLaptop = true; - isNixos = false; - isBtrfs = false; + home-manager.users."leon.schwarzaeugl".home = { + username = lib.mkForce "leon.schwarzaeugl"; + swarselsystems = { + isDarwin = true; + isLaptop = true; + isNixos = false; + isBtrfs = false; + }; }; - system.stateVersion = 4; } #+end_src @@ -2993,6 +2989,7 @@ This section is for setting things that should be used on hosts that are using t { imports = [ ./settings.nix + ./home-manager.nix ./xserver.nix ./users.nix ./env.nix @@ -3041,7 +3038,6 @@ This section is for setting things that should be used on hosts that are using t **** General NixOS settings (enable home-manager module, stateVersion) -First, we enable the use of =home-manager= as a NixoS module. Also, we disable the warnings that trigger when rebuilding with a dirty flake. At this point, I am also disabling channels and pinning the flake registry - the latter lets me use the local version of nixpkgs for commands like =nix shell= (without it, we will always download the newest version of nixpkgs for these commands). @@ -3070,14 +3066,24 @@ Also, the system state version is set here. No need to touch it. nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; }; + + system.stateVersion = lib.mkDefault "23.05"; + + } + #+end_src + +**** Setup home-manager + +First, we enable the use of =home-manager= as a NixoS modul. + +#+begin_src nix :tangle profiles/common/nixos/home-manager.nix + { inputs, ... }: + { home-manager = { useGlobalPkgs = true; useUserPackages = true; extraSpecialArgs = inputs; # used mainly for inputs.self }; - - system.stateVersion = lib.mkDefault "23.05"; - } #+end_src @@ -4526,6 +4532,7 @@ Also, the system state version is set here. No need to touch it. { imports = [ "${profilesPath}/common/nixos/settings.nix" + "${profilesPath}/common/nixos/home-manager.nix" "${profilesPath}/common/nixos/xserver.nix" "${profilesPath}/common/nixos/gc.nix" "${profilesPath}/common/nixos/store.nix" @@ -5989,6 +5996,33 @@ Also, the system state version is set here. No need to touch it. } #+end_src +*** Darwin +**** Imports + +This section sets up all the imports that are used in the home-manager section. + +#+begin_src nix :tangle profiles/darwin/common/nixos/default.nix + { self, ... }: + let + profilesPath = "${self}/profiles"; + in + { + imports = [ + "${profilesPath}/common/nixos/home-manager.nix" + ]; + + nix.settings.experimental-features = "nix-command flakes"; + nixpkgs = { + hostPlatform = "x86_64-darwin"; + inherit (outputs) overlays; + config = { + allowUnfree = true; + }; + }; + + system.stateVersion = 4; + } +#+end_src *** Optional :PROPERTIES: @@ -8905,6 +8939,24 @@ As for the `home.sessionVariables`, it should be noted that environment variable } #+end_src +*** Darwin + +**** Imports + +This section sets up all the imports that are used in the home-manager section. + +#+begin_src nix :tangle profiles/darwin/common/home/default.nix + { self, ... }: + let + profilesPath = "${self}/profiles"; + in + { + imports = [ + "${profilesPath}/common/home/settings.nix" + ]; + } +#+end_src + *** Optional :PROPERTIES: :CUSTOM_ID: h:be623200-557e-4bb7-bb11-1ec5d76c6b8b @@ -9649,7 +9701,7 @@ We set a hook that runs everytime we save the file. It would be a bit more effic (let ((org-confirm-babel-evaluate nil)) ;; (org-html-export-to-html) (org-babel-tangle) - ;; (swarsel/run-formatting) + (swarsel/run-formatting) ))) (setq org-html-htmlize-output-type nil) diff --git a/flake.nix b/flake.nix index 7c7b6ca..b54a791 100644 --- a/flake.nix +++ b/flake.nix @@ -14,96 +14,96 @@ }; inputs = { - + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05"; - + systems.url = "github:nix-systems/default-linux"; - + # user-level configuration home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - + # overlay to access bleeding edge emacs emacs-overlay = { url = "github:nix-community/emacs-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; - + # nix user repository # i use this mainly to not have to build all firefox extensions # myself as well as for the emacs-init package (tbd) nur.url = "github:nix-community/NUR"; - + # provides GL to non-NixOS hosts nixgl.url = "github:guibou/nixGL"; - + # manages all theming using Home-Manager stylix.url = "github:danth/stylix"; - + # nix secrets management sops-nix.url = "github:Mic92/sops-nix"; - + # enable secure boot on NixOS lanzaboote.url = "github:nix-community/lanzaboote"; - + # nix for android nix-on-droid = { url = "github:nix-community/nix-on-droid/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; }; - + # generate NixOS images nixos-generators = { url = "github:nix-community/nixos-generators"; inputs.nixpkgs.follows = "nixpkgs"; }; - + # hardware quirks on nix nixos-hardware = { url = "github:NixOS/nixos-hardware/master"; }; - + # dynamic library loading nix-alien = { url = "github:thiagokokada/nix-alien"; }; - + # automatic nintendo switch payload injection nswitch-rcm-nix = { url = "github:Swarsel/nswitch-rcm-nix"; }; - + # weekly updated nix-index database nix-index-database = { url = "github:nix-community/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; }; - + disko = { - url = "github:nix-community/disko"; - inputs.nixpkgs.follows = "nixpkgs"; + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; }; - + impermanence.url = "github:nix-community/impermanence"; - + zjstatus = { url = "github:dj95/zjstatus"; }; - + fw-fanctrl = { url = "github:TamtamHero/fw-fanctrl/packaging/nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - + nix-darwin = { url = "github:lnl7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; }; - + }; outputs = @@ -118,7 +118,7 @@ let inherit (self) outputs; lib = nixpkgs.lib // home-manager.lib; - + forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); pkgsFor = lib.genAttrs (import systems) ( system: @@ -127,7 +127,7 @@ config.allowUnfree = true; } ); - + # NixOS modules that can only be used on NixOS systems nixModules = [ inputs.stylix.nixosModules.stylix @@ -138,19 +138,19 @@ inputs.nswitch-rcm-nix.nixosModules.nswitch-rcm ./profiles/common/nixos ]; - + # Home-Manager modules wanted on non-NixOS systems homeModules = [ inputs.stylix.homeManagerModules.stylix ]; - + # Home-Manager modules wanted on both NixOS and non-NixOS systems mixedModules = [ inputs.sops-nix.homeManagerModules.sops inputs.nix-index-database.hmModules.nix-index ./profiles/common/home ]; - + # For adding things to _module.args (making arguments available globally) # moduleArgs = [ # { @@ -159,13 +159,13 @@ # ]; in { - + inherit lib; inherit mixedModules; # inherit moduleArgs; nixosModules = import ./modules/nixos; homeManagerModules = import ./modules/home; - + packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; }); devShells = forEachSystem (pkgs: @@ -185,7 +185,7 @@ inputs.emacs-overlay.overlay inputs.nixgl.overlay ]; - + # NixOS setups - run home-manager as a NixOS module for better compatibility # another benefit - full rebuild on nixos-rebuild switch # run rebuild using `nswitch` @@ -194,8 +194,8 @@ # Make sure to move hardware-configuration to the appropriate location, by default it is found in /etc/nixos/. nixosConfigurations = { - - + + live = lib.nixosSystem { specialArgs = { inherit inputs outputs; }; system = "x86_64-linux"; @@ -204,21 +204,21 @@ ./profiles/live ]; }; - + nbl-imba-2 = lib.nixosSystem { specialArgs = { inherit self inputs outputs; }; modules = nixModules ++ [ ./profiles/nbl-imba-2 ]; }; - + winters = lib.nixosSystem { specialArgs = { inherit self inputs outputs; }; modules = [ ./profiles/server/winters ]; }; - + #ovm swarsel sync = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; @@ -227,7 +227,7 @@ ./profiles/remote/oracle/sync/nixos.nix ]; }; - + #ovm swarsel swatrix = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; @@ -242,37 +242,37 @@ # run rebuild using `hmswitch` homeConfigurations = { - - "swarsel@home-manager" = inputs.home-manager.lib.homeManagerConfiguration { + + "swarsel@home-manager" = inputs.home-manager.lib.homeManagerConfiguration { pkgs = pkgsFor.x86_64-linux; extraSpecialArgs = { inherit inputs outputs; }; - modules = homeModules ++ mixedModules ++ [ - ./profiles/home-manager - ]; - }; - + modules = homeModules ++ mixedModules ++ [ + ./profiles/home-manager + ]; + }; + }; darwinConfigurations = { - + "nbm-imba-166" = inputs.nix-darwin.lib.darwinSystem { - specialArgs = { inherit inputs outputs; }; + specialArgs = { inherit inputs outputs; }; modules = [ ./profiles/nbm-imba-166 ]; }; - + }; nixOnDroidConfigurations = { - + mysticant = inputs.nix-on-droid.lib.nixOnDroidConfiguration { - pkgs = pkgsFor.aarch64-linux; + pkgs = pkgsFor.aarch64-linux; modules = [ ./profiles/mysticant ]; }; - + }; }; diff --git a/index.html b/index.html index a02c5a0..174011a 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + SwarselSystems: NixOS + Emacs Configuration @@ -246,15 +246,17 @@
  • 3.3. NixOS
  • 3.4. Home-manager
  • 3.5. flake.nix template @@ -287,7 +289,7 @@
  • 4.3.1. General setup
  • 4.3.2. Mark all themes as safe
  • 4.3.3. Show less compilation warnings
  • -
  • 4.3.4. Better garbage collection
  • +
  • 4.3.4. Better garbage collection
  • 4.3.5. Indentation
  • 4.3.6. Scrolling
  • 4.3.7. Evil
  • @@ -308,14 +310,14 @@ @@ -359,7 +361,7 @@

    -This file has 48987 words spanning 12817 lines and was last revised on 2024-12-05 02:11:17 +0100. +This file has 49106 words spanning 12869 lines and was last revised on 2024-12-05 02:52:40 +0100.

    @@ -409,7 +411,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry

    -My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-12-05 02:11:17 +0100) +My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-12-05 02:52:40 +0100)

    @@ -1156,7 +1158,7 @@ This section mainly exists house different `configuration.nix` files for system
      -
    1. live (ISO)
      +
    2. live (ISO)
      { inputs, outputs, config, pkgs, lib, ... }:
      @@ -1539,7 +1541,7 @@ in
       
    3. -
    4. Winters (Server)
      +
    5. Winters (Server)
      { self, inputs, outputs, config, ... }:
      @@ -1620,51 +1622,47 @@ in
       
    6. -
    7. nbm-imba-166 (MacBook Pro)
      +
    8. nbm-imba-166 (MacBook Pro)
      -
      { inputs, outputs, config, ... }:
      +
      { self, inputs, outputs, ... }:
      +let
      +  profilesPath = "${self}/profiles";
      +in
       {
      -
         imports = [
      +    "${profilesPath}/darwin/common/nixos"
      +
           inputs.home-manager.darwinModules.home-manager
           {
      -      home-manager.useGlobalPkgs = true;
      -      home-manager.useUserPackages = true;
             home-manager.users."leon.schwarzaeugl".imports = [
      +        "${profilesPath}/darwin/common/home"
             ] ++ (builtins.attrValues outputs.homeManagerModules);
           }
         ] ++ (builtins.attrValues outputs.nixosModules);
       
      -  nix.settings.experimental-features = "nix-command flakes";
      -  nixpkgs = {
      -    hostPlatform = "x86_64-darwin";
      -    inherit (outputs) overlays;
      -    config = {
      -      allowUnfree = true;
      -    };
      -  };
       
         # Auto upgrade nix package and the daemon service.
         services.nix-daemon.enable = true;
         services.karabiner-elements.enable = true;
       
      -  home-manager.users."leon.schwarzaeugl".home.stateVersion = "23.05";
      -  home-manager.users."leon.schwarzaeugl".swarselsystems = {
      -    isDarwin = true;
      -    isLaptop = true;
      -    isNixos = false;
      -    isBtrfs = false;
      +  home-manager.users."leon.schwarzaeugl".home = {
      +    username = lib.mkForce "leon.schwarzaeugl";
      +    swarselsystems = {
      +      isDarwin = true;
      +      isLaptop = true;
      +      isNixos = false;
      +      isBtrfs = false;
      +    };
         };
       
      -  system.stateVersion = 4;
       
       }
       
    9. -
    10. Magicant (Phone)
      +
    11. Magicant (Phone)
      @@ -2913,7 +2911,7 @@ writeShellApplication {
       
    12. -
    13. screenshare
      +
    14. screenshare
      @@ -3121,7 +3119,7 @@ in
       
    15. -
    16. Input
      +
    17. Input
      { lib, ... }:
      @@ -3437,7 +3435,7 @@ These are some extra options that will be used if the machine also runs NixOS. F
       
    18. -
    19. darwin
      +
    20. darwin
      { lib,  ... }:
      @@ -3550,7 +3548,7 @@ These are system-level settings specific to NixOS machines. All settings that ar
       

        -
      1. Imports, non-server settings
        +
      2. Imports, non-server settings

        This section is for setting things that should be used on hosts that are using the default NixOS configuration. This means that servers should NOT import this, as much of these imported modules are user-configured. @@ -3561,6 +3559,7 @@ This section is for setting things that should be used on hosts that are using t { imports = [ ./settings.nix + ./home-manager.nix ./xserver.nix ./users.nix ./env.nix @@ -3609,12 +3608,8 @@ This section is for setting things that should be used on hosts that are using t

    21. -
    22. General NixOS settings (enable home-manager module, stateVersion)
      +
    23. General NixOS settings (enable home-manager module, stateVersion)
      -

      -First, we enable the use of home-manager as a NixoS module. -

      -

      Also, we disable the warnings that trigger when rebuilding with a dirty flake. At this point, I am also disabling channels and pinning the flake registry - the latter lets me use the local version of nixpkgs for commands like nix shell (without it, we will always download the newest version of nixpkgs for these commands).

      @@ -3624,7 +3619,7 @@ Also, the system state version is set here. No need to touch it.

      -
      { self, lib, inputs, ... }:
      +
      { lib, inputs, ... }:
       {
         nix =
           let
      @@ -3646,14 +3641,28 @@ Also, the system state version is set here. No need to touch it.
             nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
           };
       
      +
      +  system.stateVersion = lib.mkDefault "23.05";
      +
      +}
      +
      +
      +
      +
    24. +
    25. Setup home-manager
      +
      +

      +First, we enable the use of home-manager as a NixoS modul. +

      + +
      +
      { inputs, ... }:
      +{
         home-manager = {
           useGlobalPkgs = true;
           useUserPackages = true;
           extraSpecialArgs = inputs; # used mainly for inputs.self
         };
      -
      -  system.stateVersion = lib.mkDefault "23.05";
      -
       }
       
      @@ -5138,8 +5147,8 @@ A friend of mine used this service and I used to make fun of him. But I have to
    26. -
    27. Podmam (distrobox)
      -
      +
    28. Podmam (distrobox)
      +

      I am using distrobox to quickly circumvent isses that I cannot immediately solve on NixOS. It is always the goal to quickly get things working on NixOS, but this prevents me from getting completely stuck.

      @@ -5161,8 +5170,8 @@ I am using distrobox to quickly circumvent isses that I cannot immediately solve
    29. -
    30. Handle lid switch correctly
      -
      +
    31. Handle lid switch correctly
      +

      This turns off the display when the lid is closed.

      @@ -5200,12 +5209,12 @@ This turns off the display when the lid is closed.
    -
    -

    3.3.2. Server

    +
    +

    3.3.2. Server

      -
    1. Imports
      +
    2. Imports

      First, we enable the use of home-manager as a NixoS module. @@ -5227,6 +5236,7 @@ in { imports = [ "${profilesPath}/common/nixos/settings.nix" + "${profilesPath}/common/nixos/home-manager.nix" "${profilesPath}/common/nixos/xserver.nix" "${profilesPath}/common/nixos/gc.nix" "${profilesPath}/common/nixos/store.nix" @@ -5261,7 +5271,7 @@ in

    -
  • General NixOS Server settings
    +
  • General NixOS Server settings
    { lib, config, ... }:
    @@ -5282,7 +5292,7 @@ in
     
  • -
  • System Packages
    +
  • System Packages
    { pkgs, ... }:
    @@ -5299,7 +5309,7 @@ in
     
  • -
  • sops
    +
  • sops
    { config, ... }:
    @@ -5315,7 +5325,7 @@ in
     
  • -
  • nfs/samba (smb)
    +
  • nfs/samba (smb)
    { pkgs, ... }:
    @@ -5371,7 +5381,7 @@ in
     
  • -
  • NGINX
    +
  • NGINX
    { pkgs, config, ... }:
    @@ -5413,7 +5423,7 @@ in
     
  • -
  • ssh
    +
  • ssh
    _:
    @@ -5436,7 +5446,7 @@ in
     
  • -
  • kavita
    +
  • kavita
    { pkgs, lib, config, ... }:
    @@ -5485,7 +5495,7 @@ in
     
  • -
  • jellyfin
    +
  • jellyfin
    { pkgs, lib, config, ... }:
    @@ -5536,7 +5546,7 @@ in
     
  • -
  • navidrome
    +
  • navidrome
    { pkgs, lib, config, ... }:
    @@ -5636,7 +5646,7 @@ in
     
  • -
  • spotifyd
    +
  • spotifyd
    { lib, config, ... }:
    @@ -5677,7 +5687,7 @@ in
     
  • -
  • mpd
    +
  • mpd
    { pkgs, lib, config, ... }:
    @@ -5735,7 +5745,7 @@ in
     
  • -
  • matrix
    +
  • matrix
    { config, lib, pkgs, sops, ... }:
    @@ -6060,7 +6070,7 @@ in
     
  • -
  • nextcloud
    +
  • nextcloud
    { pkgs, lib, config, ... }:
    @@ -6110,7 +6120,7 @@ in
     
  • -
  • immich
    +
  • immich
    { lib, config, ... }:
    @@ -6166,7 +6176,7 @@ in
     
  • -
  • paperless
    +
  • paperless
    { lib, config, ... }:
    @@ -6223,7 +6233,7 @@ in
     
  • -
  • transmission
    +
  • transmission
    { pkgs, lib, config, ... }:
    @@ -6363,7 +6373,7 @@ in
     
  • -
  • syncthing
    +
  • syncthing
    { lib, config, ... }:
    @@ -6474,7 +6484,7 @@ in
     
  • -
  • restic
    +
  • restic
    { lib, config, ... }:
    @@ -6489,7 +6499,7 @@ in
     
  • -
  • monitoring
    +
  • monitoring
    { lib, config, ... }:
    @@ -6656,7 +6666,7 @@ in
     
  • -
  • Jenkins
    +
  • Jenkins
    { pkgs, lib, config, ... }:
    @@ -6698,7 +6708,7 @@ in
     
  • -
  • Emacs (RSS Server)
    +
  • Emacs (RSS Server)
    { lib, config, ... }:
    @@ -6736,8 +6746,46 @@ in
     
  • +
    +

    3.3.3. Darwin

    +
    +
    +
      +
    1. Imports
      +
      +

      +This section sets up all the imports that are used in the home-manager section. +

      + +
      +
      { self, ... }:
      +let
      +  profilesPath = "${self}/profiles";
      +in
      +{
      +  imports = [
      +    "${profilesPath}/common/nixos/home-manager.nix"
      +  ];
      +
      +  nix.settings.experimental-features = "nix-command flakes";
      +  nixpkgs = {
      +    hostPlatform = "x86_64-darwin";
      +    inherit (outputs) overlays;
      +    config = {
      +      allowUnfree = true;
      +    };
      +  };
      +
      +  system.stateVersion = 4;
      +}
      +
      +
      +
      +
    2. +
    +
    -

    3.3.3. Optional

    +

    3.3.4. Optional

    These sets of configuration do not need to be deployed on every host, for a multitude of reasons. @@ -6820,8 +6868,8 @@ This sets the VirtualBox configuration. Guest should not be enabled if not direl

    -
  • VmWare
    -
    +
  • VmWare
    +

    This sets the VirtualBox configuration. Guest should not be enabled if not direly needed, it will make rebuilds unbearably slow.

    @@ -7063,7 +7111,7 @@ This section sets up all the imports that are used in the home-manager section.
  • -
  • General home-manager-settings
    +
  • General home-manager-settings

    Again, we adapt nix to our needs, enable the home-manager command for non-NixOS machines (NixOS machines are using it as a module) and setting user information that I always keep the same. @@ -8167,7 +8215,7 @@ Here we set some aliases (some of them should be shellApplications instead) as w

  • -
  • zellij
    +
  • zellij
    _:
    @@ -8375,7 +8423,7 @@ Here we set some aliases (some of them should be shellApplications instead) as w
     
  • -
  • tmux
    +
  • tmux
    @@ -9476,7 +9524,7 @@ in
                 "${modifier}+Ctrl+p" = "exec 1password --quick-acces";
                 "${modifier}+Escape" = "mode $exit";
                 "${modifier}+Shift+Escape" = "exec kitty -o confirm_os_window_close=0 btm";
    -            "${modifier}+h" = "exec hyprpicker";
    +            "${modifier}+h" = "exec hyprpicker | wl-copy";
                 "${modifier}+s" = "exec grim -g \"$(slurp)\" -t png - | wl-copy -t image/png";
                 "${modifier}+Shift+s" = "exec slurp | grim -g - Pictures/Screenshots/$(date +'screenshot_%Y-%m-%d-%H%M%S.png')";
                 "${modifier}+1" = "workspace 1:一";
    @@ -9760,12 +9808,12 @@ This service changes the screen hue at night. I am not sure if that really does
     
  • -
    -

    3.4.2. Server

    +
    +

    3.4.2. Server

      -
    1. Imports
      +
    2. Imports

      This section sets up all the imports that are used in the home-manager section. @@ -9786,7 +9834,7 @@ in

    -
  • Linking dotfiles
    +
  • Linking dotfiles

    This section should be used in order to symlink already existing configuration files using `home.file` and setting session variables using `home.sessionVariables`. @@ -9812,8 +9860,35 @@ As for the `home.sessionVariables`, it should be noted that environment variable

  • +
    +

    3.4.3. Darwin

    +
    +
    +
      +
    1. Imports
      +
      +

      +This section sets up all the imports that are used in the home-manager section. +

      + +
      +
      { self, ... }:
      +let
      +  profilesPath = "${self}/profiles";
      +in
      +{
      +  imports = [
      +    "${profilesPath}/common/home/settings.nix"
      +  ];
      +}
      +
      +
      +
      +
    2. +
    +
    -

    3.4.3. Optional

    +

    3.4.4. Optional

    Akin to the optional NixOS modules. @@ -11076,7 +11151,7 @@ We set a hook that runs everytime we save the file. It would be a bit more effic (let ((org-confirm-babel-evaluate nil)) ;; (org-html-export-to-html) (org-babel-tangle) - ;; (swarsel/run-formatting) + (swarsel/run-formatting) ))) (setq org-html-htmlize-output-type nil) @@ -11259,7 +11334,7 @@ This formats the org code block at point in accordance to the

    -
  • Disable garbace collection while minibuffer is active
    +
  • Disable garbace collection while minibuffer is active
    @@ -11631,8 +11706,8 @@ When Emacs compiles stuff, it often shows a bunch of warnings that I do not need
     
  • -
    -

    4.3.4. Better garbage collection

    +
    +

    4.3.4. Better garbage collection

    (setq garbage-collection-messages t)
    @@ -12877,8 +12952,8 @@ This adds a rudimentary nix-mode to Emacs. I have not really tried this out, as
     
    -
    -

    4.4.3. HCL Mode

    +
    +

    4.4.3. HCL Mode

    This adds support for Hashicorp Configuration Language. I need this at work. @@ -12895,8 +12970,8 @@ This adds support for Hashicorp Configuration Language. I need this at work.

    -
    -

    4.4.4. Jenkinsfile/Groovy

    +
    +

    4.4.4. Jenkinsfile/Groovy

    This adds support for Groovy, which I specifically need to work with Jenkinsfiles. I need this at work. @@ -12913,8 +12988,8 @@ This adds support for Groovy, which I specifically need to work with Jenkinsfile

    -
    -

    4.4.5. Dockerfile

    +
    +

    4.4.5. Dockerfile

    This adds support for Dockerfiles. I need this at work. @@ -12929,8 +13004,8 @@ This adds support for Dockerfiles. I need this at work.

    -
    -

    4.4.6. Terraform Mode

    +
    +

    4.4.6. Terraform Mode

    This adds support for Terraform configuration files. I need this at work. @@ -13025,8 +13100,8 @@ This mode is not automatically activated anywhere because I only rarely need it.

    -
    -

    4.4.10. elfeed

    +
    +

    4.4.10. elfeed

    -
    -

    4.4.33. sideline-flymake

    +
    +

    4.4.33. sideline-flymake

    This brings back warnings and errors on the sideline for eglot; a feature that I have been missing from lsp-mode for a while. @@ -14444,8 +14519,8 @@ This sets up the dashboard, which is really quite useless. But, it

    -
    -

    4.4.45. vterm

    +
    +

    4.4.45. vterm

    @@ -14568,7 +14643,7 @@ Prints a reasuring message to proove good faith."
     
    diff --git a/modules/home/darwin.nix b/modules/home/darwin.nix index dea20b6..69cb513 100644 --- a/modules/home/darwin.nix +++ b/modules/home/darwin.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ lib, ... }: { options.swarselsystems.isDarwin = lib.mkEnableOption "darwin host"; } diff --git a/profiles/common/home/default.nix b/profiles/common/home/default.nix index b6ba468..7697a97 100644 --- a/profiles/common/home/default.nix +++ b/profiles/common/home/default.nix @@ -1,6 +1,6 @@ _: { - imports = [ + imports = [ ./settings.nix ./packages.nix ./custom-packages.nix diff --git a/profiles/common/home/stylix.nix b/profiles/common/home/stylix.nix index 737b045..0eb35e9 100644 --- a/profiles/common/home/stylix.nix +++ b/profiles/common/home/stylix.nix @@ -1,7 +1,7 @@ { lib, config, pkgs, ... }: { stylix = lib.mkIf (!config.swarselsystems.isNixos) { - + enable = true; base16Scheme = ../../../wallpaper/swarsel.yaml; # base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml"; @@ -25,7 +25,7 @@ # name = "FiraCode Nerd Font Propo"; # name = "Montserrat"; }; - + sansSerif = { # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; }); package = pkgs.cantarell-fonts; @@ -34,18 +34,18 @@ # name = "FiraCode Nerd Font Propo"; # name = "Montserrat"; }; - + monospace = { package = pkgs.nerdfonts; # has overrides name = "FiraCode Nerd Font Mono"; }; - + emoji = { package = pkgs.noto-fonts-emoji; name = "Noto Color Emoji"; }; }; - + image = config.swarselsystems.wallpaper; targets = { emacs.enable = false; diff --git a/profiles/common/home/symlink.nix b/profiles/common/home/symlink.nix index e95595c..06d120c 100644 --- a/profiles/common/home/symlink.nix +++ b/profiles/common/home/symlink.nix @@ -24,7 +24,7 @@ }; }; -xdg.configFile = { + xdg.configFile = { "tridactyl/tridactylrc".source = self + /programs/firefox/tridactyl/tridactylrc; "tridactyl/themes/base16-codeschool.css".source = self + /programs/firefox/tridactyl/themes/base16-codeschool.css; }; diff --git a/profiles/common/nixos/default.nix b/profiles/common/nixos/default.nix index b73d078..edfc4b5 100644 --- a/profiles/common/nixos/default.nix +++ b/profiles/common/nixos/default.nix @@ -2,6 +2,7 @@ _: { imports = [ ./settings.nix + ./home-manager.nix ./xserver.nix ./users.nix ./env.nix diff --git a/profiles/common/nixos/home-manager.nix b/profiles/common/nixos/home-manager.nix new file mode 100644 index 0000000..5fcba0e --- /dev/null +++ b/profiles/common/nixos/home-manager.nix @@ -0,0 +1,8 @@ +{ inputs, ... }: +{ + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = inputs; # used mainly for inputs.self + }; +} diff --git a/profiles/common/nixos/networkdevices.nix b/profiles/common/nixos/networkdevices.nix index 18901fc..0ae49eb 100644 --- a/profiles/common/nixos/networkdevices.nix +++ b/profiles/common/nixos/networkdevices.nix @@ -6,25 +6,25 @@ extraBackends = [ pkgs.sane-airscan ]; }; -# enable discovery and usage of network devices (esp. printers) -services.printing = { - enable = true; - drivers = [ - pkgs.gutenprint - pkgs.gutenprintBin - ]; - browsedConf = '' - BrowseDNSSDSubTypes _cups,_print - BrowseLocalProtocols all - BrowseRemoteProtocols all - CreateIPPPrinterQueues All - BrowseProtocols all - ''; -}; + # enable discovery and usage of network devices (esp. printers) + services.printing = { + enable = true; + drivers = [ + pkgs.gutenprint + pkgs.gutenprintBin + ]; + browsedConf = '' + BrowseDNSSDSubTypes _cups,_print + BrowseLocalProtocols all + BrowseRemoteProtocols all + CreateIPPPrinterQueues All + BrowseProtocols all + ''; + }; -services.avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; -}; + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; } diff --git a/profiles/common/nixos/settings.nix b/profiles/common/nixos/settings.nix index 4e7a962..073b66d 100644 --- a/profiles/common/nixos/settings.nix +++ b/profiles/common/nixos/settings.nix @@ -1,4 +1,4 @@ -{ self, lib, inputs, ... }: +{ lib, inputs, ... }: { nix = let @@ -20,11 +20,6 @@ nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; }; - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = inputs; # used mainly for inputs.self - }; system.stateVersion = lib.mkDefault "23.05"; diff --git a/profiles/common/nixos/stylix.nix b/profiles/common/nixos/stylix.nix index 63407f9..803e14d 100644 --- a/profiles/common/nixos/stylix.nix +++ b/profiles/common/nixos/stylix.nix @@ -1,7 +1,7 @@ { pkgs, home-manager, config, ... }: { stylix = { - + enable = true; base16Scheme = ../../../wallpaper/swarsel.yaml; # base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml"; @@ -25,7 +25,7 @@ # name = "FiraCode Nerd Font Propo"; # name = "Montserrat"; }; - + sansSerif = { # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; }); package = pkgs.cantarell-fonts; @@ -34,18 +34,18 @@ # name = "FiraCode Nerd Font Propo"; # name = "Montserrat"; }; - + monospace = { package = pkgs.nerdfonts; # has overrides name = "FiraCode Nerd Font Mono"; }; - + emoji = { package = pkgs.noto-fonts-emoji; name = "Noto Color Emoji"; }; }; - + targets.grub.enable = false; # the styling makes grub more ugly image = config.swarselsystems.wallpaper; }; diff --git a/profiles/darwin/common/home/default.nix b/profiles/darwin/common/home/default.nix new file mode 100644 index 0000000..2bd83e5 --- /dev/null +++ b/profiles/darwin/common/home/default.nix @@ -0,0 +1,9 @@ +{ self, ... }: +let + profilesPath = "${self}/profiles"; +in +{ + imports = [ + "${profilesPath}/common/home/settings.nix" + ]; +} diff --git a/profiles/darwin/common/nixos/default.nix b/profiles/darwin/common/nixos/default.nix new file mode 100644 index 0000000..4644d81 --- /dev/null +++ b/profiles/darwin/common/nixos/default.nix @@ -0,0 +1,20 @@ +{ self, ... }: +let + profilesPath = "${self}/profiles"; +in +{ + imports = [ + "${profilesPath}/common/nixos/home-manager.nix" + ]; + + nix.settings.experimental-features = "nix-command flakes"; + nixpkgs = { + hostPlatform = "x86_64-darwin"; + inherit (outputs) overlays; + config = { + allowUnfree = true; + }; + }; + + system.stateVersion = 4; +} diff --git a/profiles/nbl-imba-2/default.nix b/profiles/nbl-imba-2/default.nix index a630d32..bd9a8ad 100644 --- a/profiles/nbl-imba-2/default.nix +++ b/profiles/nbl-imba-2/default.nix @@ -20,7 +20,7 @@ in inputs.home-manager.nixosModules.home-manager { - home-manager.users.swarsel.imports = outputs.mixedModules ++ [ + home-manager.users.swarsel.imports = outputs.mixedModules ++ [ "${profilesPath}/optional/home/gaming.nix" "${profilesPath}/optional/home/work.nix" ] ++ (builtins.attrValues outputs.homeManagerModules); @@ -52,15 +52,15 @@ in resumeDevice = "/dev/disk/by-label/nixos"; }; - hardware = { - amdgpu = { - opencl.enable = true; - amdvlk = { - enable = true; - support32Bit.enable = true; - }; - }; - }; + hardware = { + amdgpu = { + opencl.enable = true; + amdvlk = { + enable = true; + support32Bit.enable = true; + }; + }; + }; programs.fw-fanctrl.enable = true; diff --git a/profiles/nbm-imba-166/default.nix b/profiles/nbm-imba-166/default.nix index ba4edd8..49fcfd1 100644 --- a/profiles/nbm-imba-166/default.nix +++ b/profiles/nbm-imba-166/default.nix @@ -1,37 +1,33 @@ -{ inputs, outputs, config, ... }: +{ self, inputs, outputs, ... }: +let + profilesPath = "${self}/profiles"; +in { - imports = [ + "${profilesPath}/darwin/common/nixos" + inputs.home-manager.darwinModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; home-manager.users."leon.schwarzaeugl".imports = [ + "${profilesPath}/darwin/common/home" ] ++ (builtins.attrValues outputs.homeManagerModules); } ] ++ (builtins.attrValues outputs.nixosModules); - nix.settings.experimental-features = "nix-command flakes"; - nixpkgs = { - hostPlatform = "x86_64-darwin"; - inherit (outputs) overlays; - config = { - allowUnfree = true; - }; - }; # Auto upgrade nix package and the daemon service. services.nix-daemon.enable = true; services.karabiner-elements.enable = true; - home-manager.users."leon.schwarzaeugl".home.stateVersion = "23.05"; - home-manager.users."leon.schwarzaeugl".swarselsystems = { - isDarwin = true; - isLaptop = true; - isNixos = false; - isBtrfs = false; + home-manager.users."leon.schwarzaeugl".home = { + username = lib.mkForce "leon.schwarzaeugl"; + swarselsystems = { + isDarwin = true; + isLaptop = true; + isNixos = false; + isBtrfs = false; + }; }; - system.stateVersion = 4; } diff --git a/profiles/optional/home/work.nix b/profiles/optional/home/work.nix index a464173..8d70b51 100644 --- a/profiles/optional/home/work.nix +++ b/profiles/optional/home/work.nix @@ -57,7 +57,7 @@ profiles = { dc_adm = { id = 1; - + isDefault = false; userChrome = builtins.readFile ../../../programs/firefox/chrome/userChrome.css; extensions = with pkgs.nur.repos.rycee.firefox-addons; [ @@ -80,7 +80,7 @@ don-t-fuck-with-paste plasma-integration ]; - + search.engines = { "Nix Packages" = { urls = [{ @@ -93,7 +93,7 @@ icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@np" ]; }; - + "NixOS Wiki" = { urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; @@ -102,7 +102,7 @@ updateInterval = 24 * 60 * 60 * 1000; # every day definedAliases = [ "@nw" ]; }; - + "NixOS Options" = { urls = [{ template = "https://search.nixos.org/options"; @@ -110,11 +110,11 @@ { name = "query"; value = "{searchTerms}"; } ]; }]; - + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@no" ]; }; - + "Home Manager Options" = { urls = [{ template = "https://home-manager-options.extranix.com/"; @@ -122,19 +122,19 @@ { name = "query"; value = "{searchTerms}"; } ]; }]; - + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@hm" "@ho" "@hmo" ]; }; - + "Google".metaData.alias = "@g"; }; search.force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart - + }; cl_adm = { id = 2; - + isDefault = false; userChrome = builtins.readFile ../../../programs/firefox/chrome/userChrome.css; extensions = with pkgs.nur.repos.rycee.firefox-addons; [ @@ -157,7 +157,7 @@ don-t-fuck-with-paste plasma-integration ]; - + search.engines = { "Nix Packages" = { urls = [{ @@ -170,7 +170,7 @@ icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@np" ]; }; - + "NixOS Wiki" = { urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; @@ -179,7 +179,7 @@ updateInterval = 24 * 60 * 60 * 1000; # every day definedAliases = [ "@nw" ]; }; - + "NixOS Options" = { urls = [{ template = "https://search.nixos.org/options"; @@ -187,11 +187,11 @@ { name = "query"; value = "{searchTerms}"; } ]; }]; - + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@no" ]; }; - + "Home Manager Options" = { urls = [{ template = "https://home-manager-options.extranix.com/"; @@ -199,19 +199,19 @@ { name = "query"; value = "{searchTerms}"; } ]; }]; - + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@hm" "@ho" "@hmo" ]; }; - + "Google".metaData.alias = "@g"; }; search.force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart - + }; ws_adm = { id = 3; - + isDefault = false; userChrome = builtins.readFile ../../../programs/firefox/chrome/userChrome.css; extensions = with pkgs.nur.repos.rycee.firefox-addons; [ @@ -234,7 +234,7 @@ don-t-fuck-with-paste plasma-integration ]; - + search.engines = { "Nix Packages" = { urls = [{ @@ -247,7 +247,7 @@ icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@np" ]; }; - + "NixOS Wiki" = { urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; @@ -256,7 +256,7 @@ updateInterval = 24 * 60 * 60 * 1000; # every day definedAliases = [ "@nw" ]; }; - + "NixOS Options" = { urls = [{ template = "https://search.nixos.org/options"; @@ -264,11 +264,11 @@ { name = "query"; value = "{searchTerms}"; } ]; }]; - + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@no" ]; }; - + "Home Manager Options" = { urls = [{ template = "https://home-manager-options.extranix.com/"; @@ -276,15 +276,15 @@ { name = "query"; value = "{searchTerms}"; } ]; }]; - + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@hm" "@ho" "@hmo" ]; }; - + "Google".metaData.alias = "@g"; }; search.force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart - + }; }; }; @@ -311,38 +311,38 @@ xdg = { mimeApps = { defaultApplications = { - "x-scheme-handler/msteams" = [ "teams-for-linux.desktop"] ; + "x-scheme-handler/msteams" = [ "teams-for-linux.desktop" ]; }; }; desktopEntries = - let - terminal = false; - categories = [ "Application" ]; - icon = "firefox"; - in - { - firefox_dc = { - name = "Firefox (dc_adm)"; - genericName = "Firefox dc"; - exec = "firefox -p dc_adm"; - inherit terminal categories icon; - }; + let + terminal = false; + categories = [ "Application" ]; + icon = "firefox"; + in + { + firefox_dc = { + name = "Firefox (dc_adm)"; + genericName = "Firefox dc"; + exec = "firefox -p dc_adm"; + inherit terminal categories icon; + }; - firefox_ws = { - name = "Firefox (ws_adm)"; - genericName = "Firefox ws"; - exec = "firefox -p ws_adm"; - inherit terminal categories icon; - }; + firefox_ws = { + name = "Firefox (ws_adm)"; + genericName = "Firefox ws"; + exec = "firefox -p ws_adm"; + inherit terminal categories icon; + }; - firefox_cl = { - name = "Firefox (cl_adm)"; - genericName = "Firefox cl"; - exec = "firefox -p cl_adm"; - inherit terminal categories icon; - }; + firefox_cl = { + name = "Firefox (cl_adm)"; + genericName = "Firefox cl"; + exec = "firefox -p cl_adm"; + inherit terminal categories icon; + }; - }; + }; }; } diff --git a/profiles/optional/nixos/work.nix b/profiles/optional/nixos/work.nix index 8bb0022..5d10c96 100644 --- a/profiles/optional/nixos/work.nix +++ b/profiles/optional/nixos/work.nix @@ -52,10 +52,12 @@ swtpm.enable = true; ovmf = { enable = true; - packages = [(pkgs.OVMF.override { - secureBoot = true; - tpmSupport = true; - }).fd]; + packages = [ + (pkgs.OVMF.override { + secureBoot = true; + tpmSupport = true; + }).fd + ]; }; }; }; diff --git a/profiles/server/common/home/default.nix b/profiles/server/common/home/default.nix index 76457ef..4eb4489 100644 --- a/profiles/server/common/home/default.nix +++ b/profiles/server/common/home/default.nix @@ -3,7 +3,7 @@ let profilesPath = "${self}/profiles"; in { - imports = [ + imports = [ "${profilesPath}/common/home/settings.nix" ./symlink.nix ]; diff --git a/profiles/server/common/nixos/default.nix b/profiles/server/common/nixos/default.nix index c675105..72806e5 100644 --- a/profiles/server/common/nixos/default.nix +++ b/profiles/server/common/nixos/default.nix @@ -4,34 +4,35 @@ let in { imports = [ - "${profilesPath}/common/nixos/settings.nix" - "${profilesPath}/common/nixos/xserver.nix" - "${profilesPath}/common/nixos/gc.nix" - "${profilesPath}/common/nixos/store.nix" - "${profilesPath}/common/nixos/time.nix" - "${profilesPath}/common/nixos/pipewire.nix" - "${profilesPath}/common/nixos/users.nix" - "${profilesPath}/common/nixos/nix-ld.nix" - ./settings.nix - ./packages.nix - ./sops.nix - ./ssh.nix - ./nfs.nix - ./nginx.nix - ./kavita.nix - ./jellyfin.nix - ./navidrome.nix - ./spotifyd.nix - ./mpd.nix - ./matrix.nix - ./nextcloud.nix - ./immich.nix - ./paperless.nix - ./transmission.nix - ./syncthing.nix - ./restic.nix - ./monitoring.nix - ./jenkins.nix - ./emacs.nix + "${profilesPath}/common/nixos/settings.nix" + "${profilesPath}/common/nixos/home-manager.nix" + "${profilesPath}/common/nixos/xserver.nix" + "${profilesPath}/common/nixos/gc.nix" + "${profilesPath}/common/nixos/store.nix" + "${profilesPath}/common/nixos/time.nix" + "${profilesPath}/common/nixos/pipewire.nix" + "${profilesPath}/common/nixos/users.nix" + "${profilesPath}/common/nixos/nix-ld.nix" + ./settings.nix + ./packages.nix + ./sops.nix + ./ssh.nix + ./nfs.nix + ./nginx.nix + ./kavita.nix + ./jellyfin.nix + ./navidrome.nix + ./spotifyd.nix + ./mpd.nix + ./matrix.nix + ./nextcloud.nix + ./immich.nix + ./paperless.nix + ./transmission.nix + ./syncthing.nix + ./restic.nix + ./monitoring.nix + ./jenkins.nix + ./emacs.nix ]; } diff --git a/profiles/server/winters/default.nix b/profiles/server/winters/default.nix index 96125eb..4ccb496 100644 --- a/profiles/server/winters/default.nix +++ b/profiles/server/winters/default.nix @@ -15,7 +15,7 @@ in inputs.home-manager.nixosModules.home-manager { home-manager.users.swarsel.imports = [ - "${profilesPath}/server/common/home" + "${profilesPath}/server/common/home" ] ++ (builtins.attrValues outputs.homeManagerModules); } diff --git a/programs/emacs/init.el b/programs/emacs/init.el index d5f047b..f6ae6c7 100644 --- a/programs/emacs/init.el +++ b/programs/emacs/init.el @@ -186,7 +186,7 @@ create a new one." (let ((org-confirm-babel-evaluate nil)) ;; (org-html-export-to-html) (org-babel-tangle) - ;; (swarsel/run-formatting) + (swarsel/run-formatting) ))) (setq org-html-htmlize-output-type nil)