diff --git a/_machines/lauretta.nix b/_machines/lauretta.nix new file mode 100644 index 0000000..21ca5b7 --- /dev/null +++ b/_machines/lauretta.nix @@ -0,0 +1,14 @@ +{ + config, + inputs, + ... +}: { + config.flake.nixosConfigurations.lauretta = inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + outputs = config.flake; + suiteModules = config.flake.modules; + }; + modules = [../nixos/configuration.nix]; + }; +} diff --git a/_machines/vm.nix b/_machines/vm.nix new file mode 100644 index 0000000..5d1bb79 --- /dev/null +++ b/_machines/vm.nix @@ -0,0 +1,14 @@ +{ + config, + inputs, + ... +}: { + config.flake.nixosConfigurations.vm = inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + outputs = config.flake; + suiteModules = config.flake.modules; + }; + modules = [../nixos/configuration-vm.nix]; + }; +} diff --git a/azos-core b/azos-core index 72c8e88..383a85b 160000 --- a/azos-core +++ b/azos-core @@ -1 +1 @@ -Subproject commit 72c8e88c1158a254a624521135364f4fdc0c2601 +Subproject commit 383a85b9a5a9640c89ce31649c8dd2ad78d2b092 diff --git a/features/audio/default.nix b/features/audio/default.nix new file mode 100644 index 0000000..08bfcf0 --- /dev/null +++ b/features/audio/default.nix @@ -0,0 +1,41 @@ +{...}: { + config.flake.modules.homeManager.audio = { + lib, + config, + ... + }: { + options.azos.home-audio.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.home-audio.enable {}; + }; + + config.flake.modules.nixos.audio = { + lib, + config, + pkgs, + ... + }: { + options.azos.hardware-audio.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.hardware-audio.enable { + services = { + pipewire = { + enable = true; + audio.enable = true; + pulse.enable = true; + alsa = { + enable = true; + support32Bit = true; + }; + jack.enable = true; + }; + }; + environment.systemPackages = with pkgs; [pavucontrol]; + musnix.enable = true; + }; + }; +} diff --git a/features/binfmt/default.nix b/features/binfmt/default.nix new file mode 100644 index 0000000..2220be7 --- /dev/null +++ b/features/binfmt/default.nix @@ -0,0 +1,15 @@ +{...}: { + config.flake.modules.nixos.binfmt = { + lib, + config, + ... + }: { + options.azos.binfmt.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.binfmt.enable { + boot.binfmt.emulatedSystems = ["aarch64-linux"]; + }; + }; +} diff --git a/features/bluetooth/default.nix b/features/bluetooth/default.nix new file mode 100644 index 0000000..f272b56 --- /dev/null +++ b/features/bluetooth/default.nix @@ -0,0 +1,16 @@ +{...}: { + config.flake.modules.nixos.bluetooth = { + lib, + config, + ... + }: { + options.azos.bluetooth.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.bluetooth.enable { + services.blueman.enable = true; + hardware.bluetooth.enable = true; + }; + }; +} diff --git a/features/claude/default.nix b/features/claude/default.nix new file mode 100644 index 0000000..4ac5c5f --- /dev/null +++ b/features/claude/default.nix @@ -0,0 +1,16 @@ +{...}: { + config.flake.modules.homeManager.claude = { + lib, + config, + pkgs, + ... + }: { + options.azos.claude.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.claude.enable { + home.packages = with pkgs; [claude-code claude-agent-acp]; + }; + }; +} diff --git a/features/encryption/default.nix b/features/encryption/default.nix new file mode 100644 index 0000000..bf559b1 --- /dev/null +++ b/features/encryption/default.nix @@ -0,0 +1,37 @@ +{...}: { + config.flake.modules.homeManager.encryption = { + lib, + config, + pkgs, + ... + }: { + options.azos.encryption.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.encryption.enable { + programs.password-store = { + enable = true; + settings = { + PASSWORD_STORE_KEY = "076AA297579A0064"; + }; + }; + home.packages = with pkgs; [ + yubikey-personalization + pinentry-gtk2 + ]; + programs.gpg = { + enable = true; + }; + services.gpg-agent = { + enable = true; + enableSshSupport = true; + grabKeyboardAndMouse = false; + pinentry.package = pkgs.pinentry-gtk2; + }; + home.file.".ssh/config".source = ./ssh-config; + home.file.".ssh/gpg-as-ssh.pub".source = ./gpg-as-ssh.pub; + home.file.".gnupg/sshcontrol".source = ./sshcontrol; + }; + }; +} diff --git a/modules/home-manager/gpg-as-ssh.pub b/features/encryption/gpg-as-ssh.pub similarity index 100% rename from modules/home-manager/gpg-as-ssh.pub rename to features/encryption/gpg-as-ssh.pub diff --git a/modules/home-manager/ssh-config b/features/encryption/ssh-config similarity index 100% rename from modules/home-manager/ssh-config rename to features/encryption/ssh-config diff --git a/modules/home-manager/sshcontrol b/features/encryption/sshcontrol similarity index 100% rename from modules/home-manager/sshcontrol rename to features/encryption/sshcontrol diff --git a/features/git-config/default.nix b/features/git-config/default.nix new file mode 100644 index 0000000..14bdcef --- /dev/null +++ b/features/git-config/default.nix @@ -0,0 +1,32 @@ +{...}: { + config.flake.modules.homeManager.git-config = { + lib, + config, + pkgs, + ... + }: { + options.azos.git-config.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.git-config.enable { + home.packages = with pkgs; [pass-git-helper unzip]; + programs.git = { + enable = true; + signing = { + key = "6D17E295C70E2674"; + signByDefault = true; + }; + settings = { + credential.helper = "!pass-git-helper $@"; + user = { + name = "Aner Zakobar"; + email = "aner@zakobar.com"; + }; + }; + }; + home.file.".config/pass-git-helper/git-pass-mapping.ini".source = + ./pass-git-mapping.ini; + }; + }; +} diff --git a/modules/home-manager/pass-git-mapping.ini b/features/git-config/pass-git-mapping.ini similarity index 100% rename from modules/home-manager/pass-git-mapping.ini rename to features/git-config/pass-git-mapping.ini diff --git a/features/headphones/default.nix b/features/headphones/default.nix new file mode 100644 index 0000000..307b722 --- /dev/null +++ b/features/headphones/default.nix @@ -0,0 +1,20 @@ +{...}: { + config.flake.modules.homeManager.headphones = { + lib, + config, + pkgs, + ... + }: { + options.azos.headphones-whmx4000.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.headphones-whmx4000.enable { + home.packages = [ + (pkgs.writeShellScriptBin + "azos-connect-headphones-whmx4000" + "echo \"connect AC:80:0A:AF:E1:C2\" | bluetoothctl") + ]; + }; + }; +} diff --git a/features/hfsprogs/default.nix b/features/hfsprogs/default.nix new file mode 100644 index 0000000..fc957b2 --- /dev/null +++ b/features/hfsprogs/default.nix @@ -0,0 +1,16 @@ +{...}: { + config.flake.modules.homeManager.hfsprogs = { + lib, + config, + pkgs, + ... + }: { + options.azos.hfsprogs.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.hfsprogs.enable { + home.packages = with pkgs; [hfsprogs]; + }; + }; +} diff --git a/features/hyprland/default.nix b/features/hyprland/default.nix new file mode 100644 index 0000000..4237aac --- /dev/null +++ b/features/hyprland/default.nix @@ -0,0 +1,36 @@ +{...}: { + config.flake.modules.homeManager.hyprland = { + lib, + config, + pkgs, + ... + }: { + options.azos.suites.hyprland.enable = lib.mkOption { + default = false; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.suites.hyprland.enable { + home.packages = with pkgs; [ + hyprland + waybar + wofi + kitty + grim + slurp + swappy + networkmanagerapplet + xwayland + ]; + azos.emacs.enabledSuites = ["azos-emacs-hyprland"]; + azos.emacs.pkgs = [pkgs.azos-emacs-hyprland]; + azos.emacs.emacspkg = pkgs.emacs-pgtk; + home.file.".login.sh" = { + text = '' + #!/usr/bin/env bash + ${pkgs.hyprland}/bin/Hyprland + ''; + executable = true; + }; + }; + }; +} diff --git a/pkgs/azos-emacs-hyprland.nix b/features/hyprland/emacs/_pkg.nix similarity index 81% rename from pkgs/azos-emacs-hyprland.nix rename to features/hyprland/emacs/_pkg.nix index d6115b5..b69682b 100755 --- a/pkgs/azos-emacs-hyprland.nix +++ b/features/hyprland/emacs/_pkg.nix @@ -6,7 +6,7 @@ orgTrivialBuild { pname = "azos-emacs-hyprland"; version = "0.1.6"; - src = ./elisp/azos-emacs-hyprland.org; + src = ./config.org; packageRequires = with epkgs; [ pkgs.azos-emacs-base ]; diff --git a/pkgs/elisp/azos-emacs-hyprland.org b/features/hyprland/emacs/config.org similarity index 100% rename from pkgs/elisp/azos-emacs-hyprland.org rename to features/hyprland/emacs/config.org diff --git a/features/hyprland/emacs/default.nix b/features/hyprland/emacs/default.nix new file mode 100644 index 0000000..8f94c17 --- /dev/null +++ b/features/hyprland/emacs/default.nix @@ -0,0 +1,3 @@ +{...}: { + config.flake.overlayPkgs.azos-emacs-hyprland = pkgs: pkgs.localEmacsPkg ./_pkg.nix; +} diff --git a/features/kubernetes/default.nix b/features/kubernetes/default.nix new file mode 100644 index 0000000..9918fb7 --- /dev/null +++ b/features/kubernetes/default.nix @@ -0,0 +1,16 @@ +{...}: { + config.flake.modules.homeManager.kubernetes = { + lib, + config, + pkgs, + ... + }: { + options.azos.kubectl.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.kubectl.enable { + home.packages = with pkgs; [kubectl kubernetes-helm velero]; + }; + }; +} diff --git a/features/lauretta/default.nix b/features/lauretta/default.nix new file mode 100644 index 0000000..eecee76 --- /dev/null +++ b/features/lauretta/default.nix @@ -0,0 +1,18 @@ +{...}: { + config.flake.modules.homeManager.lauretta = { + lib, + config, + pkgs, + ... + }: { + options.azos.suites.lauretta.enable = lib.mkOption { + default = false; + type = lib.types.bool; + }; + config = lib.mkIf (config.azos.emacs.enable && config.azos.suites.lauretta.enable) { + azos.emacs.enabledSuites = ["azos-emacs-lauretta"]; + azos.emacs.pkgs = [pkgs.azos-emacs-lauretta]; + home.packages = with pkgs; [nix-search-cli]; + }; + }; +} diff --git a/pkgs/azos-emacs-lauretta.nix b/features/lauretta/emacs/_pkg.nix similarity index 88% rename from pkgs/azos-emacs-lauretta.nix rename to features/lauretta/emacs/_pkg.nix index b30a221..248fe62 100755 --- a/pkgs/azos-emacs-lauretta.nix +++ b/features/lauretta/emacs/_pkg.nix @@ -6,7 +6,7 @@ orgTrivialBuild { pname = "azos-emacs-lauretta"; version = "0.1.6"; - src = ./elisp/azos-emacs-lauretta.org; + src = ./config.org; packageRequires = with epkgs; [ pkgs.azos-emacs-base pkgs.azos-emacs-dev diff --git a/pkgs/elisp/azos-emacs-lauretta.org b/features/lauretta/emacs/config.org similarity index 100% rename from pkgs/elisp/azos-emacs-lauretta.org rename to features/lauretta/emacs/config.org diff --git a/features/lauretta/emacs/default.nix b/features/lauretta/emacs/default.nix new file mode 100644 index 0000000..fedf088 --- /dev/null +++ b/features/lauretta/emacs/default.nix @@ -0,0 +1,3 @@ +{...}: { + config.flake.overlayPkgs.azos-emacs-lauretta = pkgs: pkgs.localEmacsPkg ./_pkg.nix; +} diff --git a/features/mail/default.nix b/features/mail/default.nix new file mode 100644 index 0000000..f72c9c9 --- /dev/null +++ b/features/mail/default.nix @@ -0,0 +1,76 @@ +{...}: { + config.flake.modules.homeManager.mail = { + lib, + config, + ... + }: let + default_account_params = { + realName = "Aner Zakobar"; + notmuch.enable = true; + mbsync = { + enable = true; + create = "maildir"; + }; + }; + default_gmail_params = + default_account_params + // { + flavor = "gmail.com"; + }; + default_smtp = { + tls = { + enable = true; + certificatesFile = "/etc/ssl/certs/ca-certificates.crt"; + }; + }; + in { + options.azos.mail.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.mail.enable { + programs = { + notmuch = { + enable = true; + hooks = {preNew = "mbsync -a";}; + }; + mbsync.enable = true; + msmtp.enable = true; + lieer.enable = true; + }; + services.lieer.enable = true; + accounts.email.accounts = { + gmail = + default_gmail_params + // { + address = "anerisgreat@gmail.com"; + userName = "anerisgreat"; + passwordCommand = "pass gmail.com/mbsync-anerisgreat"; + }; + bgu = + default_gmail_params + // { + address = "anerz@post.bgu.ac.il"; + userName = "anerz@post.bgu.ac.il"; + passwordCommand = "pass post.bgu.ac.il/mbsync-anerz"; + }; + zakobar = + default_account_params + // { + address = "aner@zakobar.com"; + msmtp.enable = true; + primary = true; + userName = "aner@zakobar.com"; + imap = {host = "mail.privateemail.com";}; + smtp = + default_smtp + // { + port = 587; + host = "mail.privateemail.com"; + }; + passwordCommand = "pass zakobar.com/mail/aner"; + }; + }; + }; + }; +} diff --git a/features/mpris-proxy/default.nix b/features/mpris-proxy/default.nix new file mode 100644 index 0000000..9cd022c --- /dev/null +++ b/features/mpris-proxy/default.nix @@ -0,0 +1,15 @@ +{...}: { + config.flake.modules.homeManager.mpris-proxy = { + lib, + config, + ... + }: { + options.azos.mpris-proxy.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.mpris-proxy.enable { + services.mpris-proxy.enable = true; + }; + }; +} diff --git a/features/nextcloud/default.nix b/features/nextcloud/default.nix new file mode 100644 index 0000000..a33d02d --- /dev/null +++ b/features/nextcloud/default.nix @@ -0,0 +1,20 @@ +{...}: { + config.flake.modules.homeManager.nextcloud = { + lib, + config, + pkgs, + ... + }: { + options.azos.nextcloud-client.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.nextcloud-client.enable { + home.packages = with pkgs; [nextcloud-client]; + services.nextcloud-client = { + enable = true; + startInBackground = false; + }; + }; + }; +} diff --git a/features/opencode/default.nix b/features/opencode/default.nix new file mode 100644 index 0000000..d045cfa --- /dev/null +++ b/features/opencode/default.nix @@ -0,0 +1,15 @@ +{...}: { + config.flake.modules.homeManager.opencode = { + lib, + config, + ... + }: { + options.azos.opencode.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.opencode.enable { + programs.opencode.enable = true; + }; + }; +} diff --git a/modules/home-manager/qutebrowser-config.py b/features/qutebrowser/config.py similarity index 100% rename from modules/home-manager/qutebrowser-config.py rename to features/qutebrowser/config.py diff --git a/features/qutebrowser/default.nix b/features/qutebrowser/default.nix new file mode 100644 index 0000000..dfed6e7 --- /dev/null +++ b/features/qutebrowser/default.nix @@ -0,0 +1,15 @@ +{...}: { + config.flake.modules.homeManager.qutebrowser = { + lib, + config, + ... + }: { + options.azos.qutebrowser-config.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.qutebrowser-config.enable { + home.file.".config/qutebrowser/config.py".source = ./config.py; + }; + }; +} diff --git a/features/reaper/default.nix b/features/reaper/default.nix new file mode 100644 index 0000000..3970588 --- /dev/null +++ b/features/reaper/default.nix @@ -0,0 +1,21 @@ +{...}: { + config.flake.modules.homeManager.reaper = { + lib, + config, + pkgs, + ... + }: { + options.azos.reaper.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.reaper.enable { + home.packages = with pkgs; [ + reaper + helm + lsp-plugins + vital + ]; + }; + }; +} diff --git a/features/snx-rs/default.nix b/features/snx-rs/default.nix new file mode 100644 index 0000000..e09efc0 --- /dev/null +++ b/features/snx-rs/default.nix @@ -0,0 +1,61 @@ +{...}: { + config.flake.modules.homeManager.snx-rs = { + lib, + config, + pkgs, + ... + }: let + cfg = config.azos.snx-rs; + in { + options.azos.snx-rs = { + enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + server = lib.mkOption { + default = "vpn.bgu.ac.il"; + type = lib.types.str; + description = "VPN server address"; + }; + username = lib.mkOption { + default = "anerz@vpn"; + type = lib.types.str; + description = "VPN username"; + }; + loginType = lib.mkOption { + default = "vpn"; + type = lib.types.str; + description = "Login type"; + }; + ignoreServerCert = lib.mkOption { + default = true; + type = lib.types.bool; + description = "Ignore server certificate validation"; + }; + }; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + snx-rs + (pkgs.writeShellScriptBin "snx-connect" '' + #!/bin/sh + sudo ${pkgs.snx-rs}/bin/snx-rs -m command & + sleep 1 + ${pkgs.snx-rs}/bin/snxctl connect + '') + (pkgs.writeShellScriptBin "snx-disconnect" '' + #!/bin/sh + ${pkgs.snx-rs}/bin/snxctl disconnect + pkill -x snx-rs 2>/dev/null || true + '') + ]; + home.file.".config/snx-rs/snx-rs.conf" = { + text = '' + server ${cfg.server} + username ${cfg.username} + login-type ${cfg.loginType} + ignore-server-cert ${lib.boolToString cfg.ignoreServerCert} + ''; + }; + }; + }; +} diff --git a/features/steam/default.nix b/features/steam/default.nix new file mode 100644 index 0000000..3907720 --- /dev/null +++ b/features/steam/default.nix @@ -0,0 +1,15 @@ +{...}: { + config.flake.modules.nixos.steam = { + lib, + config, + ... + }: { + options.azos.steam.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.steam.enable { + programs.steam.enable = true; + }; + }; +} diff --git a/features/virtualization/default.nix b/features/virtualization/default.nix new file mode 100644 index 0000000..afecee4 --- /dev/null +++ b/features/virtualization/default.nix @@ -0,0 +1,30 @@ +{...}: { + config.flake.modules.nixos.virtualization = { + lib, + config, + pkgs, + ... + }: { + options.azos.virtualization.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.virtualization.enable { + virtualisation.libvirtd = { + enable = true; + qemu = { + swtpm.enable = true; + }; + }; + environment.systemPackages = with pkgs; [ + qemu_kvm + libvirt + virt-manager + virt-viewer + ]; + services.spice-vdagentd.enable = true; + networking.firewall.allowedTCPPorts = [5900 5901]; + networking.firewall.allowedUDPPorts = [5900 5901]; + }; + }; +} diff --git a/features/ytdl/default.nix b/features/ytdl/default.nix new file mode 100644 index 0000000..c6876ce --- /dev/null +++ b/features/ytdl/default.nix @@ -0,0 +1,16 @@ +{...}: { + config.flake.modules.homeManager.ytdl = { + lib, + config, + pkgs, + ... + }: { + options.azos.ytdl.enable = lib.mkOption { + default = true; + type = lib.types.bool; + }; + config = lib.mkIf config.azos.ytdl.enable { + home.packages = with pkgs; [yt-dlp]; + }; + }; +} diff --git a/flake.lock b/flake.lock index 5d536bb..ebf178f 100644 --- a/flake.lock +++ b/flake.lock @@ -4,7 +4,8 @@ "inputs": { "cabata": "cabata", "evil-hl-line": "evil-hl-line", - "nixpkgs": "nixpkgs_3" + "flake-parts": "flake-parts", + "import-tree": "import-tree" }, "locked": { "path": "./azos-core", @@ -23,11 +24,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1771368993, - "narHash": "sha256-mWcLaCViNfUMPcqCvQRed4kR20Ifs8aaHcjMlVbF2tQ=", + "lastModified": 1779008956, + "narHash": "sha256-jpJ30XX1pAH+Mpsyj92K8t6812Qs+P4J31wO7RS/e+Y=", "owner": "anerisgreat", "repo": "cabata", - "rev": "4fa661795527fa437698409395dc4363fbc0adf0", + "rev": "ff1871152ffb635e18e1a9804750192c6969d1cb", "type": "github" }, "original": { @@ -55,6 +56,42 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1778716662, + "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1778716662, + "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": [ @@ -102,11 +139,11 @@ ] }, "locked": { - "lastModified": 1778954430, - "narHash": "sha256-oaNyOr05lblaQdtbkbN1wO0b2KLIL2O1LkmwDgdQp4I=", + "lastModified": 1779627636, + "narHash": "sha256-J6JGf42zNzLo/CrRdKb5dNznpLI+eGxN/5KTLG1Mo5s=", "owner": "nix-community", "repo": "home-manager", - "rev": "26aaab785b0bab4af60a2c42b22760fa906ef22a", + "rev": "044c30c19550c0557997dece4ce9e54d2fa77ba1", "type": "github" }, "original": { @@ -116,9 +153,39 @@ "type": "github" } }, + "import-tree": { + "locked": { + "lastModified": 1778781969, + "narHash": "sha256-Jjuz5CmSkur8KvLDoGa+vylEp+RkQtv4mt/qcMznpH0=", + "owner": "vic", + "repo": "import-tree", + "rev": "d321337efd0f23a9eb14a42adb7b2c29313ab274", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, + "import-tree_2": { + "locked": { + "lastModified": 1778781969, + "narHash": "sha256-Jjuz5CmSkur8KvLDoGa+vylEp+RkQtv4mt/qcMznpH0=", + "owner": "vic", + "repo": "import-tree", + "rev": "d321337efd0f23a9eb14a42adb7b2c29313ab274", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, "musnix": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1777848538, @@ -136,11 +203,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1778945272, - "narHash": "sha256-Aipz0UiBhE2a1FYJrNc2y+5vKWo5QVkhmaIJk3/ls+g=", + "lastModified": 1779258371, + "narHash": "sha256-j1iZsLy6oFApqR1oiDmHhvkwxXqcNi0aoSJj643LuwU=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "379c1f274f0fa354d012f0600806de54e79f29b5", + "rev": "c97bc4d15bd3473dd095e8e8ba57330ab1943a77", "type": "github" }, "original": { @@ -164,13 +231,43 @@ "type": "indirect" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1777168982, + "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-lib_2": { + "locked": { + "lastModified": 1777168982, + "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs-unstable": { "locked": { - "lastModified": 1778869304, - "narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", + "lastModified": 1779508470, + "narHash": "sha256-Ap9KJX+5xHIn3bPIpfNgT6MEXdAECECwo4/rmlQD74M=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d233902339c02a9c334e7e593de68855ad26c4cb", + "rev": "29916453413845e54a65b8a1cf996842300cd299", "type": "github" }, "original": { @@ -182,11 +279,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1778443072, - "narHash": "sha256-zi7/fsqM/kFdNuED//4WOCUtezGtKKqRNORjMvfwjnA=", + "lastModified": 1779508470, + "narHash": "sha256-Ap9KJX+5xHIn3bPIpfNgT6MEXdAECECwo4/rmlQD74M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "da5ad661ba4e5ef59ba743f0d112cbc30e474f32", + "rev": "29916453413845e54a65b8a1cf996842300cd299", "type": "github" }, "original": { @@ -197,20 +294,6 @@ } }, "nixpkgs_3": { - "locked": { - "lastModified": 1774273680, - "narHash": "sha256-a++tZ1RQsDb1I0NHrFwdGuRlR5TORvCEUksM459wKUA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "fdc7b8f7b30fdbedec91b71ed82f36e1637483ed", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_4": { "locked": { "lastModified": 1777268161, "narHash": "sha256-bxrdOn8SCOv8tN4JbTF/TXq7kjo9ag4M+C8yzzIRYbE=", @@ -226,13 +309,13 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { - "lastModified": 1778869304, - "narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", + "lastModified": 1779536132, + "narHash": "sha256-q+fF42iv/geEbHfgSzy3tS0FF/EyD6XTZ98E6yxiBO8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d233902339c02a9c334e7e593de68855ad26c4cb", + "rev": "3d8f0f3f72a6cd4d93d0ad13203f2ea1cb7e1456", "type": "github" }, "original": { @@ -245,10 +328,12 @@ "root": { "inputs": { "azos-core": "azos-core", + "flake-parts": "flake-parts_2", "home-manager": "home-manager", + "import-tree": "import-tree_2", "musnix": "musnix", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "nixpkgs-unstable": "nixpkgs-unstable" } }, diff --git a/flake.nix b/flake.nix index 0a86f7a..630c999 100755 --- a/flake.nix +++ b/flake.nix @@ -2,14 +2,7 @@ description = "Aner's NIX config for his systems!"; inputs = { - # self.submodules = true; - # Nixpkgs - #Temporarily - # nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; - #Need unstable for opencode and agent-shell nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - - # Unused unstable nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager = { @@ -19,58 +12,41 @@ nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - #Music production nix musnix = {url = "github:musnix/musnix";}; azos-core = { url = "./azos-core"; flake = true; }; + + flake-parts.url = "github:hercules-ci/flake-parts"; + import-tree.url = "github:vic/import-tree"; }; - outputs = { - self, - nixpkgs, - home-manager, - ... - } @ inputs: let - inherit (self) outputs; - systems = [ - "aarch64-linux" - "x86_64-linux" - "aarch64-darwin" - "x86_64-darwin" - ]; - forAllSystems = nixpkgs.lib.genAttrs systems; - in { - formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); + outputs = inputs: + inputs.flake-parts.lib.mkFlake {inherit inputs;} { + imports = [ + inputs.azos-core.flakeModules.default + ./overlays/default.nix + (inputs.import-tree ./features) + ./_machines/lauretta.nix + ./_machines/vm.nix + ]; - overlays = import ./overlays {inherit inputs;}; - azos-core.nixosModules = inputs.azos-core.nixosModules.nixosModules; - nixosModules = import ./modules/nixos; - azos-core.homeManagerModules = inputs.azos-core.nixosModules.homeManagerModules; - homeManagerModules = import ./modules/home-manager; + systems = [ + "aarch64-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; - #Systems configured - nixosConfigurations = { - #Lauretta - laptop - lauretta = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [ - ./nixos/configuration.nix - ]; - }; - - #Test VM - vm = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [ - ./nixos/configuration-vm.nix - ]; + perSystem = { + system, + pkgs, + ... + }: { + formatter = pkgs.alejandra; + devShells = (import ./shells) {inherit pkgs;}; }; }; - - #TODO the devshells do not know of the new packages. - devShells = forAllSystems (system: ((import ./shells) {pkgs = nixpkgs.legacyPackages.${system};})); - }; } diff --git a/home-manager/home.nix b/home-manager/home.nix index 654def3..fa5b2f0 100755 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,16 +1,35 @@ -# This is your home-manager configuration file -# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) { inputs, outputs, + suiteModules, lib, config, pkgs, ... }: { imports = [ - outputs.homeManagerModules - outputs.azos-core.homeManagerModules + suiteModules.homeManager.base + suiteModules.homeManager.dev + suiteModules.homeManager.editor + suiteModules.homeManager.station + suiteModules.homeManager.exwm + suiteModules.homeManager.lauretta + suiteModules.homeManager.audio + suiteModules.homeManager.claude + suiteModules.homeManager.encryption + suiteModules.homeManager.git-config + suiteModules.homeManager.hfsprogs + suiteModules.homeManager.headphones + suiteModules.homeManager.hyprland + suiteModules.homeManager.kubernetes + suiteModules.homeManager.mail + suiteModules.homeManager.mpris-proxy + suiteModules.homeManager.nextcloud + suiteModules.homeManager.opencode + suiteModules.homeManager.qutebrowser + suiteModules.homeManager.reaper + suiteModules.homeManager.snx-rs + suiteModules.homeManager.ytdl ]; programs.home-manager.enable = true; @@ -28,9 +47,7 @@ homeDirectory = "/home/aner"; }; - # Nicely reload system units when changing configs systemd.user.startServices = "sd-switch"; - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion home.stateVersion = "25.11"; } diff --git a/modules/home-manager/audio.nix b/modules/home-manager/audio.nix deleted file mode 100755 index 48972ae..0000000 --- a/modules/home-manager/audio.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.home-audio.enable; -in { - options.azos.home-audio.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - # home.packages = with pkgs; [pavucontrol]; - }; -} diff --git a/modules/home-manager/claude.nix b/modules/home-manager/claude.nix deleted file mode 100644 index 4826b68..0000000 --- a/modules/home-manager/claude.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.claude.enable; -in { - options.azos.claude.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - home.packages = with pkgs; [claude-code claude-agent-acp]; - }; -} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix deleted file mode 100755 index 2dab3a5..0000000 --- a/modules/home-manager/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - imports = [ - ./audio.nix - ./claude.nix - ./encryption.nix - ./git.nix - ./hfsprogs.nix - ./headphones-whmx4000.nix - ./hyprland-suite.nix - ./kubernetes.nix - ./lauretta-emacs.nix - ./mail.nix - ./mpris-proxy.nix - ./opencode.nix - # ./printing.nix - # ./gnuradio.nix - ./qutebrowser-config.nix - ./reaper.nix - ./snx-rs.nix - ./ytdl.nix - ./nextcloud-client.nix - ]; -} diff --git a/modules/home-manager/encryption.nix b/modules/home-manager/encryption.nix deleted file mode 100755 index b79a46f..0000000 --- a/modules/home-manager/encryption.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.encryption.enable; -in { - options.azos.encryption.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - programs.password-store = { - enable = true; - settings = { - PASSWORD_STORE_KEY = "076AA297579A0064"; - }; - }; - - home.packages = with pkgs; [ - yubikey-personalization - pinentry-gtk2 - ]; - programs.gpg = { - enable = true; - }; - services.gpg-agent = { - enable = true; - enableSshSupport = true; - grabKeyboardAndMouse = false; - pinentry.package = pkgs.pinentry-gtk2; - }; - - home.file.".ssh/config".source = ./ssh-config; - home.file.".ssh/gpg-as-ssh.pub".source = ./gpg-as-ssh.pub; - home.file.".gnupg/sshcontrol".source = ./sshcontrol; - }; -} diff --git a/modules/home-manager/git.nix b/modules/home-manager/git.nix deleted file mode 100755 index 93526d3..0000000 --- a/modules/home-manager/git.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.git-config.enable; -in { - options.azos.git-config.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - home.packages = with pkgs; [pass-git-helper unzip]; - - programs.git = { - enable = true; - - signing = { - key = "6D17E295C70E2674"; - signByDefault = true; - }; - - settings = { - credential.helper = "!pass-git-helper $@"; - user = { - name = "Aner Zakobar"; - email = "aner@zakobar.com"; - }; - }; - }; - home.file.".config/pass-git-helper/git-pass-mapping.ini".source = - ./pass-git-mapping.ini; - }; -} diff --git a/modules/home-manager/gnuradio.nix b/modules/home-manager/gnuradio.nix deleted file mode 100755 index 881cca7..0000000 --- a/modules/home-manager/gnuradio.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.gnuradio.enable; -in { - options.azos.gnuradio.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - home.packages = with pkgs; [ - gnuradio - uhd - gmp - boost - volk - libxcursor - cmake - pkg-config - spdlog - ]; - }; -} diff --git a/modules/home-manager/headphones-whmx4000.nix b/modules/home-manager/headphones-whmx4000.nix deleted file mode 100755 index 52c51ef..0000000 --- a/modules/home-manager/headphones-whmx4000.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.headphones-whmx4000.enable; -in { - options.azos.headphones-whmx4000.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - home.packages = with pkgs; [ - (pkgs.writeShellScriptBin - "azos-connect-headphones-whmx4000" - "echo \"connect AC:80:0A:AF:E1:C2\" | bluetoothctl") - ]; - }; -} diff --git a/modules/home-manager/hfsprogs.nix b/modules/home-manager/hfsprogs.nix deleted file mode 100644 index be89b1c..0000000 --- a/modules/home-manager/hfsprogs.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.hfsprogs.enable; -in { - options.azos.hfsprogs.enable = lib.mkOption { - default = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - home.packages = with pkgs; [ - hfsprogs - ]; - }; -} diff --git a/modules/home-manager/hyprland-suite.nix b/modules/home-manager/hyprland-suite.nix deleted file mode 100644 index 2ff30b7..0000000 --- a/modules/home-manager/hyprland-suite.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ - lib, - config, - pkgs, - options, - azos-utils, - ... -}: let - isEnabled = - config.azos.suites.hyprland.enable; -in { - options.azos.suites.hyprland.enable = lib.mkOption { - default = false; - example = true; - type = lib.types.bool; - }; - - #TODO shutdown reboot commands - config = lib.mkIf isEnabled { - home.packages = with pkgs; [ - hyprland - waybar # status bar - wofi # application launcher - kitty - grim # screenshot utility - slurp # region selector - swappy # screenshot editor - networkmanagerapplet - xwayland - ]; - - azos.emacs.enabledSuites = ["azos-emacs-hyprland"]; - azos.emacs.pkgs = [pkgs.azos-emacs-hyprland]; - azos.emacs.emacspkg = pkgs.emacs-pgtk; - - home.file.".login.sh" = { - text = '' - #!/usr/bin/env bash - ${pkgs.hyprland}/bin/Hyprland - ''; - #Make executable - executable = true; - }; - - # systemd.user.services.xwayland = { - # Unit.Description = "XWayland server"; - # Install.WantedBy = [ "default.target" ]; - # Service = { - # ExecStart = "${pkgs.xwayland}/bin/Xwayland :0 -rootless -terminate -listen tcp"; - # Restart = "on-failure"; - # RestartSec = "1s"; - # StandardInput = "null"; - # StandardOutput = "null"; - # StandardError = "journal"; - # }; - # }; - }; -} diff --git a/modules/home-manager/kubernetes.nix b/modules/home-manager/kubernetes.nix deleted file mode 100755 index d40c4e7..0000000 --- a/modules/home-manager/kubernetes.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.kubectl.enable; -in { - options.azos.kubectl.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - home.packages = with pkgs; [ - kubectl - kubernetes-helm - velero - ]; - }; -} diff --git a/modules/home-manager/lauretta-emacs.nix b/modules/home-manager/lauretta-emacs.nix deleted file mode 100644 index fe2e3d7..0000000 --- a/modules/home-manager/lauretta-emacs.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - lib, - config, - pkgs, - azos-utils, - ... -}: let - isEnabled = - config.azos.emacs.enable && config.azos.suites.lauretta.enable; - emacspkgs = config.azos.emacs.emacspkg.pkgs; - localPkgName = "azos-emacs-lauretta"; -in { - #Set config - options.azos.suites.lauretta.enable = azos-utils.mkSuiteEnableOption {}; - config = lib.mkIf isEnabled { - azos.emacs.enabledSuites = [localPkgName]; - - #Base emacs suite definition - azos.emacs.pkgs = [pkgs.azos-emacs-lauretta]; - - home.packages = with pkgs; [pkgs.nix-search-cli]; - }; -} diff --git a/modules/home-manager/mail.nix b/modules/home-manager/mail.nix deleted file mode 100755 index c742c06..0000000 --- a/modules/home-manager/mail.nix +++ /dev/null @@ -1,108 +0,0 @@ -#https://xeiaso.net/talks/asg-2023-nixos/ example -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.mail.enable; - default_account_params = { - realName = "Aner Zakobar"; - notmuch.enable = true; - mbsync = { - enable = true; - create = "maildir"; - }; - }; - default_gmail_params = - default_account_params - // { - # lieer.enable = true; - # lieer.sync.enable = true; - flavor = "gmail.com"; - # imap = { - # host = "mail.privateemail.com"; - # }; - }; - default_smtp = { - tls = { - enable = true; - certificatesFile = "/etc/ssl/certs/ca-certificates.crt"; - }; - }; - default_gmail_smtp = - default_smtp - // { - host = "smtp.gmail.com"; - }; -in { - options.azos.mail.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - programs = { - notmuch = { - enable = true; - hooks = { - preNew = "mbsync -a"; - }; - }; - mbsync = { - enable = true; - }; - msmtp = { - enable = true; - }; - lieer = { - enable = true; - }; - }; - services.lieer.enable = true; - accounts.email.accounts = { - gmail = - default_gmail_params - // { - address = "anerisgreat@gmail.com"; - userName = "anerisgreat"; - # smtp = default_gmail_smtp; - passwordCommand = "pass gmail.com/mbsync-anerisgreat"; - }; - bgu = - default_gmail_params - // { - address = "anerz@post.bgu.ac.il"; - userName = "anerz@post.bgu.ac.il"; - # smtp = default_gmail_smtp; - passwordCommand = "pass post.bgu.ac.il/mbsync-anerz"; - }; - zakobar = - default_account_params - // { - address = "aner@zakobar.com"; - msmtp.enable = true; - - primary = true; - userName = "aner@zakobar.com"; - imap = { - host = "mail.privateemail.com"; - }; - # mbsync = { - # enable = true; - # create = "maildir"; - # }; - - smtp = - default_smtp - // { - port = 587; - host = "mail.privateemail.com"; - }; - passwordCommand = "pass zakobar.com/mail/aner"; - }; - }; - }; -} diff --git a/modules/home-manager/mpris-proxy.nix b/modules/home-manager/mpris-proxy.nix deleted file mode 100755 index f612b31..0000000 --- a/modules/home-manager/mpris-proxy.nix +++ /dev/null @@ -1,20 +0,0 @@ -#https://xeiaso.net/talks/asg-2023-nixos/ example -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.mpris-proxy.enable; -in { - options.azos.mpris-proxy.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - services.mpris-proxy.enable = true; - }; -} diff --git a/modules/home-manager/nextcloud-client.nix b/modules/home-manager/nextcloud-client.nix deleted file mode 100755 index ca7d053..0000000 --- a/modules/home-manager/nextcloud-client.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.nextcloud-client.enable; -in { - options.azos.nextcloud-client.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - home.packages = with pkgs; [ - nextcloud-client - ]; - services.nextcloud-client = { - enable = true; - startInBackground = false; - }; - }; -} diff --git a/modules/home-manager/opencode.nix b/modules/home-manager/opencode.nix deleted file mode 100755 index f8c5ea9..0000000 --- a/modules/home-manager/opencode.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.opencode.enable; -in { - options.azos.opencode.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - programs.opencode.enable = true; - }; -} diff --git a/modules/home-manager/printing.nix b/modules/home-manager/printing.nix deleted file mode 100755 index 03ee4e1..0000000 --- a/modules/home-manager/printing.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.printing.enable; -in { - options.azos.printing.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - services.printing.enable = true; - home.packages = with pkgs; [ - hplip - ]; - }; -} diff --git a/modules/home-manager/qutebrowser-config.nix b/modules/home-manager/qutebrowser-config.nix deleted file mode 100755 index b481db7..0000000 --- a/modules/home-manager/qutebrowser-config.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.qutebrowser-config.enable; -in { - options.azos.qutebrowser-config.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - home.file.".config/qutebrowser/config.py".source = ./qutebrowser-config.py; - }; -} diff --git a/modules/home-manager/reaper.nix b/modules/home-manager/reaper.nix deleted file mode 100755 index c23c823..0000000 --- a/modules/home-manager/reaper.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.reaper.enable; -in { - options.azos.reaper.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - home.packages = with pkgs; [ - reaper - helm #TODO this synth had better work - # surge - lsp-plugins - vital - ]; - }; -} diff --git a/modules/home-manager/snx-rs.nix b/modules/home-manager/snx-rs.nix deleted file mode 100644 index 6eddd27..0000000 --- a/modules/home-manager/snx-rs.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.snx-rs.enable; - cfg = config.azos.snx-rs; -in { - options.azos.snx-rs = { - enable = lib.mkOption { - default = true; - type = lib.types.bool; - }; - server = lib.mkOption { - default = "vpn.bgu.ac.il"; - type = lib.types.str; - description = "VPN server address"; - }; - username = lib.mkOption { - default = "anerz@vpn"; - type = lib.types.str; - description = "VPN username"; - }; - loginType = lib.mkOption { - default = "vpn"; - type = lib.types.str; - description = "Login type (e.g., vpn, vpn_Microsoft_Authenticator)"; - }; - ignoreServerCert = lib.mkOption { - default = true; - type = lib.types.bool; - description = "Ignore server certificate validation"; - }; - }; - - config = lib.mkIf isEnabled { - home.packages = with pkgs; [ - snx-rs - (pkgs.writeShellScriptBin "snx-connect" '' - #!/bin/sh - sudo ${pkgs.snx-rs}/bin/snx-rs -m command & - sleep 1 - ${pkgs.snx-rs}/bin/snxctl connect - '') - (pkgs.writeShellScriptBin "snx-disconnect" '' - #!/bin/sh - ${pkgs.snx-rs}/bin/snxctl disconnect - pkill -x snx-rs 2>/dev/null || true - '') - ]; - - home.file.".config/snx-rs/snx-rs.conf" = { - text = '' - server ${cfg.server} - username ${cfg.username} - login-type ${cfg.loginType} - ignore-server-cert ${lib.boolToString cfg.ignoreServerCert} - ''; - }; - }; -} diff --git a/modules/home-manager/ytdl.nix b/modules/home-manager/ytdl.nix deleted file mode 100755 index 64ac489..0000000 --- a/modules/home-manager/ytdl.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.ytdl.enable; -in { - options.azos.ytdl.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - home.packages = with pkgs; [ - yt-dlp - ]; - }; -} diff --git a/modules/nixos/audio.nix b/modules/nixos/audio.nix deleted file mode 100644 index 482cce0..0000000 --- a/modules/nixos/audio.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.hardware-audio.enable; -in { - options.azos.hardware-audio.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - services = { - pipewire = { - enable = true; - audio.enable = true; - pulse.enable = true; - alsa = { - enable = true; - support32Bit = true; - }; - jack.enable = true; - }; - }; - # hardware.pulseaudio.enable = true; - environment.systemPackages = with pkgs; [pavucontrol]; - musnix.enable = true; - }; -} diff --git a/modules/nixos/binfmt.nix b/modules/nixos/binfmt.nix deleted file mode 100644 index a660b5c..0000000 --- a/modules/nixos/binfmt.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.binfmt.enable; -in { - options.azos.binfmt.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - boot.binfmt.emulatedSystems = ["aarch64-linux"]; - }; -} diff --git a/modules/nixos/bluetooth.nix b/modules/nixos/bluetooth.nix deleted file mode 100755 index f3f2bde..0000000 --- a/modules/nixos/bluetooth.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.bluetooth.enable; -in { - options.azos.bluetooth.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - services.blueman.enable = true; - hardware.bluetooth.enable = true; - }; -} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix deleted file mode 100755 index 5d88243..0000000 --- a/modules/nixos/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - imports = [./audio.nix ./binfmt.nix ./bluetooth.nix ./steam.nix ./virtualization.nix]; -} diff --git a/modules/nixos/steam.nix b/modules/nixos/steam.nix deleted file mode 100755 index 855c0f6..0000000 --- a/modules/nixos/steam.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.steam.enable; -in { - options.azos.steam.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - programs.steam.enable = true; - }; -} diff --git a/modules/nixos/virtualization.nix b/modules/nixos/virtualization.nix deleted file mode 100755 index 74ee919..0000000 --- a/modules/nixos/virtualization.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = - config.azos.virtualization.enable; -in { - options.azos.virtualization.enable = lib.mkOption { - default = true; - example = true; - type = lib.types.bool; - }; - - config = lib.mkIf isEnabled { - virtualisation.libvirtd = { - enable = true; # start / run libvirtd as a system service - # optional: expose the default NAT network (virbr0) – libvirtd creates it - # automatically when the daemon is on, but we make sure the bridge is - # allowed through the firewall. - qemu = { - swtpm.enable = true; # (optional) enable software TPM for guests - }; - }; - environment.systemPackages = with pkgs; [ - # QEMU (KVM‑accelerated) - qemu_kvm # same as pkgs.qemu (but with KVM support explicitly enabled) - # CLI utilities - libvirt # provides virsh, virt-install, virt-manager (cli bits) - # GUI front‑end - virt-manager # graphical manager (uses libvirt + spice) - virt-viewer # Spice/VNC client that virt‑manager calls under the hood - ]; - - services.spice-vdagentd.enable = true; # makes copy‑paste & auto‑resize work in Spice windows - networking.firewall.allowedTCPPorts = [5900 5901]; # Spice ports (adjust if you expose elsewhere) - networking.firewall.allowedUDPPorts = [5900 5901]; - }; -} diff --git a/nixos/configuration-vm.nix b/nixos/configuration-vm.nix index 11970ff..a02ff42 100755 --- a/nixos/configuration-vm.nix +++ b/nixos/configuration-vm.nix @@ -1,53 +1,42 @@ -# This is your system's configuration file. -# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) { inputs, outputs, + suiteModules, lib, config, pkgs, ... }: { - # You can import other NixOS modules here - virtualisation.vmVariant = { virtualisation.resolution = { x = 1280; y = 1024; }; virtualisation.qemu.options = [ - # Better display option "-vga virtio" "-display gtk,zoom-to-fit=false" - # Enable copy/paste - # https://www.kraxel.org/blog/2021/05/qemu-cut-paste/ "-chardev qemu-vdagent,id=ch1,name=vdagent,clipboard=on" "-device virtio-serial-pci" "-device virtserialport,chardev=ch1,id=ch1,name=com.redhat.spice.0" ]; }; + imports = [ inputs.home-manager.nixosModules.home-manager - outputs.nixosModules ]; nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs = { overlays = [ - inputs.azos-core.overlays.addpkgs - # outputs.overlays.additions - # outputs.overlays.modifications - # outputs.overlays.unstable-packages + outputs.overlays.addpkgs ]; - # Configure your nixpkgs instance config = { allowUnfree = true; }; }; nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs); - nix.nixPath = ["/etc/nix/path"]; environment.etc = lib.mapAttrs' @@ -59,21 +48,17 @@ nix.settings = { experimental-features = "nix-command flakes"; - # Deduplicate and optimize nix store auto-optimise-store = true; }; - # TODO: Set your hostname networking.hostName = "test-vm"; - # TODO: This is just an example, be sure to use whatever bootloader you prefer boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; home-manager = { - extraSpecialArgs = {inherit inputs outputs;}; + extraSpecialArgs = {inherit inputs outputs suiteModules pkgs;}; users = { - # Import your home-manager configuration aner = import ../home-manager/home.nix; }; }; @@ -82,28 +67,18 @@ aner = { initialPassword = "password"; isNormalUser = true; - openssh.authorizedKeys.keys = [ - # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect - ]; - # TODO: Be sure to add any other groups you need (such as networkmanager, audio, docker, etc) + openssh.authorizedKeys.keys = []; extraGroups = ["wheel" "libvirtd"]; }; }; - # This setups a SSH server. Very important if you're setting up a headless system. - # Feel free to remove if you don't need it. services.openssh = { enable = true; settings = { - # Forbid root login through SSH. PermitRootLogin = "no"; - # Use keys only. Remove if you want to SSH using password (not recommended) PasswordAuthentication = true; }; }; - #Graphical environment - # services.xserver.desktopManager.xfce.enable = true; - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = "24.05"; } diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 63b4a0a..5ec7bad 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,6 +1,7 @@ { inputs, outputs, + suiteModules, lib, config, pkgs, @@ -11,20 +12,22 @@ inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480 inputs.musnix.nixosModules.musnix inputs.home-manager.nixosModules.home-manager - outputs.nixosModules - outputs.azos-core.nixosModules + suiteModules.nixos.base + suiteModules.nixos.exwm + suiteModules.nixos.audio + suiteModules.nixos.bluetooth + suiteModules.nixos.steam + suiteModules.nixos.virtualization + suiteModules.nixos.binfmt ]; - # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - boot.binfmt.emulatedSystems = ["aarch64-linux"]; nixpkgs = { overlays = [ - inputs.azos-core.overlays.addpkgs outputs.overlays.addpkgs - inputs.azos-core.overlays.qutebrowserdrm + outputs.overlays.qutebrowserdrm outputs.overlays.modifications outputs.overlays.unstable-packages ]; @@ -34,20 +37,14 @@ }; nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs); - nix.nixPath = ["/etc/nix/path"]; - networking.hostName = "lauretta"; # Define your hostname. - - # Enable networking + networking.hostName = "lauretta"; networking.networkmanager.enable = true; - # Set your time zone. time.timeZone = "Asia/Jerusalem"; - # Select internationalisation properties. i18n.defaultLocale = "en_IL"; - i18n.extraLocaleSettings = { LC_ADDRESS = "he_IL.UTF-8"; LC_IDENTIFICATION = "he_IL.UTF-8"; @@ -60,7 +57,6 @@ LC_TIME = "he_IL.UTF-8"; }; - # Configure keymap in X11 services.xserver = { xkb = { layout = "us,il"; @@ -69,14 +65,11 @@ xkb.options = "grp:alt_shift_toggle"; }; - # Configure console keymap console.keyMap = "il"; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.aner = { isNormalUser = true; description = "Aner Zakobar"; - #Audio group for audio config, video group necessary for backlight. extraGroups = ["networkmanager" "wheel" "audio" "video"]; packages = with pkgs; []; }; @@ -89,17 +82,15 @@ azos.suites.exwm.enable = true; home-manager = { - extraSpecialArgs = {inherit inputs outputs pkgs;}; + extraSpecialArgs = {inherit inputs outputs suiteModules pkgs;}; users = { aner = import ../home-manager/home.nix; }; }; - # Specializations specialisation = { hyprland = { configuration = { - # Override home‑manager options for this specialization home-manager.users.aner = {pkgs, ...}: { azos.suites.exwm.enable = lib.mkForce false; azos.suites.hyprland.enable = true; @@ -108,8 +99,6 @@ }; }; - # List packages installed in system profile. To search, run: - # $ nix search wget boot.supportedFilesystems = ["exfat"]; boot.kernelModules = ["exfat"]; @@ -131,5 +120,5 @@ systemd.targets.hibernate.enable = false; systemd.targets.hybrid-sleep.enable = false; - system.stateVersion = "25.11"; # Did you read the comment? + system.stateVersion = "25.11"; } diff --git a/overlays/default.nix b/overlays/default.nix index 20fb88f..63d4f5d 100755 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,22 +1,11 @@ -# This file defines overlays {inputs, ...}: { - addpkgs = final: _prev: (import ../pkgs {pkgs = final.pkgs;}); - - #Current overlay is for helm, to disable binary, so no conflict - modifications = final: prev: { - helm = prev.helm.overrideAttrs (oldAttrs: rec { - patches = - oldAttrs.patches - or [] - ++ [ - ./helm.patch - ]; + config.flake.overlays.modifications = _final: prev: { + helm = prev.helm.overrideAttrs (oldAttrs: { + patches = oldAttrs.patches or [] ++ [./helm.patch]; }); }; - # When applied, the unstable nixpkgs set (declared in the flake inputs) will - # be accessible through 'pkgs.unstable' - unstable-packages = final: _prev: { + config.flake.overlays.unstable-packages = final: _prev: { unstable = import inputs.nixpkgs-unstable { system = final.system; config.allowUnfree = true; diff --git a/pkgs/default.nix b/pkgs/default.nix deleted file mode 100755 index af5511d..0000000 --- a/pkgs/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{pkgs} @ args: let - inherit args; - localEmacsPkg = pkgs.localEmacsPkg; -in { - azos-emacs-lauretta = localEmacsPkg ./azos-emacs-lauretta.nix; - azos-emacs-hyprland = localEmacsPkg ./azos-emacs-hyprland.nix; -}