diff --git a/flake.nix b/flake.nix index 138770b..3200eb8 100644 --- a/flake.nix +++ b/flake.nix @@ -73,6 +73,9 @@ import nixpkgs { inherit system; config.allowUnfree = true; + config.permittedInsecurePackages = [ + "olm-3.2.16" + ]; } ); in @@ -104,6 +107,12 @@ inherit inputs outputs; }; }; + kardorf = lib.nixosSystem { + modules = [ ./hosts/pianonix ]; + specialArgs = { + inherit inputs outputs; + }; + }; }; # Standalone HM @@ -130,16 +139,28 @@ inherit inputs outputs; }; }; + "julian@kardorf" = lib.homeManagerConfiguration { + modules = [ + ./homes/julian/kardorf.nix + ./homes/julian/hm-standalone-config.nix + ]; + pkgs = pkgsFor.aarch64-linux; + extraSpecialArgs = { + inherit inputs outputs; + }; + }; + "julian@v3ms" = lib.homeManagerConfiguration { + modules = [ + ./homes/julian/v3ms + ./homes/julian/hm-standalone-config.nix + ]; + pkgs = pkgsFor.aarch64-linux; + extraSpecialArgs = { + inherit inputs outputs; + }; + }; }; - # systems.modules.nixos = with inputs; [ - # sops-nix.nixosModules.sops - # disko.nixosModules.disko - # TODO: add sops and disko modules somewhere - # ]; - # systems.hosts.pianonix.modules = with inputs; [ nixos-hardware.nixosModules.raspberry-pi-4 ]; - # TODO: add rpi4 hardware modules - # deploy-rs node configuration deploy.nodes = { pianonix = { diff --git a/homes/julian/aspi.nix b/homes/julian/aspi.nix index 7214586..8430b4c 100644 --- a/homes/julian/aspi.nix +++ b/homes/julian/aspi.nix @@ -1,6 +1,3 @@ -{ - ... -}: { imports = [ ./global @@ -25,6 +22,6 @@ hostName = "aspi"; is-nixos = true; - terminal = "kitty"; # TODO: only terminal = ??? + terminal = "kitty"; } diff --git a/homes/julian/hm-standalone-config.nix b/homes/julian/hm-standalone-config.nix index c05033c..90ca91a 100644 --- a/homes/julian/hm-standalone-config.nix +++ b/homes/julian/hm-standalone-config.nix @@ -7,13 +7,13 @@ # Apply overlays nixpkgs = { overlays = builtins.attrValues outputs.overlays; - config = { - allowUnfree = true; - allowUnfreePredicate = _: true; # TODO: what is this - permittedInsecurePackages = [ - "olm-3.2.16" - ]; - }; + # config = { + # allowUnfree = true; + # allowUnfreePredicate = _: true; # TODO: what is this + # permittedInsecurePackages = [ + # "olm-3.2.16" + # ]; + # }; }; # Setup binary caches diff --git a/homes/julian/kardorf.nix b/homes/julian/kardorf.nix index 8ee8c3d..1409749 100644 --- a/homes/julian/kardorf.nix +++ b/homes/julian/kardorf.nix @@ -1,57 +1,27 @@ { - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. - lib, - # An instance of `pkgs` with your overlays and packages applied is also available. - pkgs, - # You also have access to your flake's inputs. - inputs, + imports = [ + ./global - # Additional metadata is provided by Snowfall Lib. - namespace, # The namespace used for your flake, defaulting to "internal" if not set. - home, # The home architecture for this host (eg. `x86_64-linux`). - target, # The Snowfall Lib target for this home (eg. `x86_64-home`). - format, # A normalized name for the home target (eg. `home`). - virtual, # A boolean to determine whether this home is a virtual target using nixos-generators. - host, # The host name for this home. + ./features/fish + ./features/direnv + ./features/topgrade + ./features/neovim + ./features/kitty + ./features/wezterm + ./features/yazi + ./features/emacs + ./features/i3 + ./features/nix-helper + ./features/desktop - # All other arguments come from the home home. - config, - ... -}: -{ - home.username = "julian"; - home.homeDirectory = "/home/julian"; + ./features/suites/cli + ./features/suites/desktop + ./features/suites/development - modules = { - non-nixos.is-nixos = true; - shell = { - fish.enable = true; - direnv.enable = true; - }; - topgrade.enable = true; - neovim.enable = true; - # alacritty.enable = true; - kitty.enable = true; - yazi.enable = true; - emacs.enable = true; - i3.enable = true; - nix-helper.enable = true; + ]; - desktop.enable = true; - fonts.enable = true; + hostName = "kardorf"; + is-nixos = true; + terminal = "kitty"; - suites = { - cli.enable = true; - desktop.enable = true; - development.enable = true; - }; - }; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; - - # ======================== DO NOT CHANGE THIS ======================== - home.stateVersion = "23.11"; - # ======================== DO NOT CHANGE THIS ======================== } diff --git a/homes/julian/pianonix.nix b/homes/julian/pianonix.nix index f9ea317..d35a1e2 100644 --- a/homes/julian/pianonix.nix +++ b/homes/julian/pianonix.nix @@ -1,43 +1,23 @@ { - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. - lib, - # An instance of `pkgs` with your overlays and packages applied is also available. pkgs, - # You also have access to your flake's inputs. - inputs, - - # Additional metadata is provided by Snowfall Lib. - namespace, # The namespace used for your flake, defaulting to "internal" if not set. - home, - target, # The Snowfall Lib target for this home (eg. `x86_64-home`). - format, # A normalized name for the home target (eg. `home`). - virtual, # A boolean to determine whether this home is a virtual target using nixos-generators. - host, # The host name for this home. - - # All other arguments come from the home home. - config, ... -}@arguments: +}: { - home.username = "julian"; - home.homeDirectory = "/home/julian"; + imports = [ + ./global - modules = { - non-nixos.is-nixos = true; + ./features/fish + ./features/topgrade + ./features/neovim + ./features/wezterm + ./features/yazi + ./features/nix-helper + ./features/desktop + ]; - shell = { - fish.enable = true; - }; - yazi.enable = true; - topgrade.enable = true; - neovim.enable = true; - wezterm.enable = true; - nix-helper.enable = true; - - desktop.enable = true; - fonts.enable = true; - }; + hostName = "pianonix"; + is-nixos = true; + terminal = "wezterm"; services.syncthing.tray.enable = true; services.syncthing.tray.command = "syncthingtray --wait"; # Wait for tray to become available @@ -60,11 +40,4 @@ working_directory = "/home/julian/Klavier" ''; }; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; - - # ======================== DO NOT CHANGE THIS ======================== - home.stateVersion = "23.11"; - # ======================== DO NOT CHANGE THIS ======================== } diff --git a/homes/julian/ssh.pub b/homes/julian/ssh.pub new file mode 100644 index 0000000..e143656 --- /dev/null +++ b/homes/julian/ssh.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFjSZYdoF/51F+ykcBAYVCzCPTF5EEigWBL1APiR0h+H diff --git a/homes/julian/v3ms/default.nix b/homes/julian/v3ms/default.nix index 929524b..c42b559 100644 --- a/homes/julian/v3ms/default.nix +++ b/homes/julian/v3ms/default.nix @@ -1,41 +1,24 @@ { - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. lib, - # An instance of `pkgs` with your overlays and packages applied is also available. pkgs, - # You also have access to your flake's inputs. - inputs, - - # Additional metadata is provided by Snowfall Lib. - namespace, # The namespace used for your flake, defaulting to "internal" if not set. - home, # The home architecture for this host (eg. `x86_64-linux`). - target, # The Snowfall Lib target for this home (eg. `x86_64-home`). - format, # A normalized name for the home target (eg. `home`). - virtual, # A boolean to determine whether this home is a virtual target using nixos-generators. - host, # The host name for this home. - - # All other arguments come from the home home. - config, ... }: { - home.username = "julian"; - home.homeDirectory = "/home/julian"; + imports = [ + ../global - modules = { - non-nixos.is-nixos = false; - shell = { - fish.enable = true; - direnv.enable = true; - }; - topgrade.enable = true; - neovim.enable = true; - yazi.enable = true; - emacs.enable = true; + ../features/fish + ../features/direnv + ../features/topgrade + ../features/neovim + ../features/yazi + ../features/emacs + ../features/nix-helper + ]; - nix-helper.enable = true; - }; + hostName = "aspi"; + is-nixos = false; + # terminal = "kitty"; home.packages = lib.lists.concatMap (packages-list-file: import packages-list-file { inherit pkgs; }) @@ -43,11 +26,4 @@ ./fonts.nix ./packages.nix ]; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; - - # ======================== DO NOT CHANGE THIS ======================== - home.stateVersion = "23.11"; - # ======================== DO NOT CHANGE THIS ======================== } diff --git a/hosts/builder/default.nix b/hosts/builder/default.nix index 2443c60..ab0ba71 100644 --- a/hosts/builder/default.nix +++ b/hosts/builder/default.nix @@ -4,7 +4,11 @@ { config, pkgs, ... }: { - imports = [ ./hardware-configuration.nix ]; + imports = [ + ./hardware-configuration.nix + + ../common/global + ]; # hardware.graphics = { # enable = true; diff --git a/hosts/common/global/sops.nix b/hosts/common/global/sops.nix index e34ed01..3595373 100644 --- a/hosts/common/global/sops.nix +++ b/hosts/common/global/sops.nix @@ -18,5 +18,8 @@ in keyFile = "/home/julian/.config/sops/age/keys.txt"; # Generate key if none of the above worked. With this, building will still work, just without secrets generateKey = true; + }; + + sops.defaultSopsFile = ../secrets.yaml; } diff --git a/hosts/kardorf/default.nix b/hosts/kardorf/default.nix index d3bba9f..871373c 100644 --- a/hosts/kardorf/default.nix +++ b/hosts/kardorf/default.nix @@ -11,38 +11,35 @@ ... }: { - imports = [ ./hardware-configuration.nix ]; + imports = [ + # inputs.hardware.nixosModules.common-cpu-amd # TODO something useful for me? + + ./hardware-configuration.nix + + ../common/global + ../common/users/julian + + # ../common/optional/openssh.nix + # ../common/optional/greetd.nix + ../common/optional/pipewire.nix + ../common/optional/remote-builder.nix + ../common/optional/boot-efi.nix + ../common/optional/pcmanfm.nix + ../common/optional/i3.nix + ../common/optional/gdm.nix + ../common/optional/redshift.nix + ../common/optional/virtualbox.nix + ../common/optional/xdg-portal.nix + ../common/optional/polkit.nix # TODO: maybe not needed! + ../common/optional/keyring.nix # TODO: maybe not needed! + ]; networking.hostName = "kardorf"; # Define your hostname. networking.networkmanager.enable = true; services.resolved.enable = true; - topology.self = { - hardware.info = "Pc Kardorf"; - }; - time.timeZone = "Europe/Berlin"; - modules = { - nix-settings.enable = true; - xserver-defaults.enable = true; - keymap.enable = true; - builder.enable = true; - system.boot-efi.enable = true; - sound.enable = true; - locales.enable = true; - pcmanfm.enable = true; - i3.enable = true; - gdm.enable = true; - virtualbox.enable = true; - users-julian.enable = true; - xdg-portal.enable = true; - polkit.enable = true; - keyring.enable = true; - redshift.enable = true; - syncthing.enable = true; - }; - boot.loader.efi.efiSysMountPoint = "/boot/efi"; services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470; diff --git a/hosts/pianonix/default.nix b/hosts/pianonix/default.nix index c628d12..628a604 100644 --- a/hosts/pianonix/default.nix +++ b/hosts/pianonix/default.nix @@ -10,7 +10,28 @@ ... }: { - imports = [ ./hardware-configuration.nix ]; + imports = [ + inputs.nixos-hardware.nixosModules.raspberry-pi-4 + + ./hardware-configuration.nix + + ../common/global + ../common/users/julian + + # ../common/optional/openssh.nix + # ../common/optional/greetd.nix + ../common/optional/pipewire.nix + ../common/optional/remote-builder.nix + # ../common/optional/boot-efi.nix + ../common/optional/pcmanfm.nix + # ../common/optional/i3.nix + # ../common/optional/gdm.nix + ../common/optional/redshift.nix + # ../common/optional/virtualbox.nix + ../common/optional/xdg-portal.nix + ../common/optional/polkit.nix # TODO: maybe not needed! + ../common/optional/keyring.nix # TODO: maybe not needed! + ]; # disko.devices.disk.main.device = "/dev/mmcblk1"; @@ -27,7 +48,7 @@ sops.secrets."vnc-passwd" = { owner = config.users.users.julian.name; - sopsFile = ../../../secrets/vnc-passwd; + sopsFile = ./vnc-passwd; format = "binary"; }; sops.secrets."wifi/pianonix" = { }; @@ -35,43 +56,15 @@ sops.secrets."syncthing/pianonix/cert" = { }; # sops.secrets."syncthing/public-keys/aspi-nix" = { }; # sops.secrets."syncthing/public-keys/pianonix" = { }; - sops.secrets."password/pianonix" = { - neededForUsers = true; # necessary for setting password - }; modules = { - sops.enable = true; - nix-settings.enable = true; - xserver-defaults.enable = true; - keymap.enable = true; - builder.enable = false; - # system.boot-efi.enable = true; - sound.enable = true; - - locales.enable = true; - pcmanfm.enable = true; - - # i3.enable = true; - # gdm.enable = true; - redshift.enable = true; - - # wayland.enable = true; - # hyprland.enable = true; - # tuigreet.enable = true; - - # virtualbox.enable = true; - users-julian.enable = true; syncthing = { enable = true; overrideSettings = true; }; - # xdg-portal.enable = true; - polkit.enable = true; - keyring.enable = true; }; users.mutableUsers = false; - users.users.julian.hashedPasswordFile = config.sops.secrets."password/pianonix".path; # Enable the Desktop Environment. # services.xserver.displayManager.lightdm.enable = true; diff --git a/overlays/default.nix b/overlays/default.nix index b88ded1..9d85e78 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,6 +1,6 @@ { inputs, - outputs, + ... }: { # For every flake input, aliases 'pkgs.inputs.${flake}' to @@ -17,8 +17,13 @@ ) inputs; }; - # Adds my custom packages - my-pkgs = final: prev: import ../pkgs { pkgs = final; }; + input-flake-packages = final: prev: { + sheet-organizer = inputs.sheet-organizer.packages.${prev.system}.default; # TODO: change sheet-organizer package output + music-reader = inputs.music-reader.defaultPackage.${prev.system}; # TODO: change music reader to packages.system + }; + + # Adds my custom packages, available as pkgs.frajul.xyz + my-pkgs = final: prev: { frajul = import ../pkgs { pkgs = final; }; }; nixpkgs-stable-unstable = final: prev: { unstable = import inputs.nixpkgs { @@ -32,8 +37,8 @@ }; # Makes gparted actually open - gparted-xhost = self: super: { - gparted-xhost = super.gparted.overrideAttrs (oldAttrs: { + gparted-xhost = final: prev: { + gparted-xhost = prev.gparted.overrideAttrs (oldAttrs: { configureFlags = oldAttrs.configureFlags ++ [ "--enable-xhost-root" ]; }); }; diff --git a/pkgs/default.nix b/pkgs/default.nix index 815d726..a75e3bf 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -3,15 +3,15 @@ ... }: { - frajul.conda-direnv = pkgs.callPackage ./conda-direnv { }; - frajul.deploy-to-pianopi = pkgs.callPackage ./deploy-to-pianopi { }; - frajul.edit-config = pkgs.callPackage ./edit-config { }; - frajul.hyprshot-gui = pkgs.callPackage ./hyprshot-gui { }; - frajul.install = pkgs.callPackage ./install { }; - frajul.lntocp = pkgs.callPackage ./lntocp { }; - frajul.open-messaging = pkgs.callPackage ./open-messaging { }; - frajul.pulseaudio-popup = pkgs.callPackage ./pulseaudio-popup { }; - frajul.sos = pkgs.callPackage ./sos { }; - frajul.xwacomcalibrate = pkgs.callPackage ./xwacomcalibrate { }; - frajul.acer-battery-health-mode = pkgs.callPackage ./acer-battery-health-mode { }; + conda-direnv = pkgs.callPackage ./conda-direnv { }; + deploy-to-pianopi = pkgs.callPackage ./deploy-to-pianopi { }; + edit-config = pkgs.callPackage ./edit-config { }; + hyprshot-gui = pkgs.callPackage ./hyprshot-gui { }; + install = pkgs.callPackage ./install { }; + lntocp = pkgs.callPackage ./lntocp { }; + open-messaging = pkgs.callPackage ./open-messaging { }; + pulseaudio-popup = pkgs.callPackage ./pulseaudio-popup { }; + sos = pkgs.callPackage ./sos { }; + xwacomcalibrate = pkgs.callPackage ./xwacomcalibrate { }; + acer-battery-health-mode = pkgs.callPackage ./acer-battery-health-mode { }; }