From 8053fc7843e2322afec1c312e54a813ddf1de1d9 Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Sun, 28 Sep 2025 02:08:03 -0600 Subject: [PATCH] flake for emacs vm --- flake.lock | 162 ++++++++++++++++++++++++++--------------------------- flake.nix | 65 ++++++++++++--------- 2 files changed, 117 insertions(+), 110 deletions(-) diff --git a/flake.lock b/flake.lock index 2de51ce..7bee608 100644 --- a/flake.lock +++ b/flake.lock @@ -103,17 +103,17 @@ "cpu-microcodes": { "flake": false, "locked": { - "lastModified": 1757762790, - "narHash": "sha256-/d9HoPNjYgXse2y3dKIVms5oeGBj5Gf3NbRJAdoYxcg=", + "lastModified": 1758484353, + "narHash": "sha256-zpbmZqUIhmTW01PunE5eXkYzQsMDqOOshr/KjNXeL7A=", "owner": "platomav", "repo": "CPUMicrocodes", - "rev": "940dd3dacd577144172372f8c8f2e176db0c9de4", + "rev": "518e82e753bbd7df44264cac38dc98e6a4ede8c6", "type": "github" }, "original": { "owner": "platomav", "repo": "CPUMicrocodes", - "rev": "940dd3dacd577144172372f8c8f2e176db0c9de4", + "rev": "518e82e753bbd7df44264cac38dc98e6a4ede8c6", "type": "github" } }, @@ -125,11 +125,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1758459839, - "narHash": "sha256-cuGhpqhsLE4LugMBRxto2y76HYa0mYGcRMb4Vm2r1wI=", + "lastModified": 1758962141, + "narHash": "sha256-DFiPYYf1zo5QWnPs6AoWfSH3/oU6ZrCLGy0/V1j6thw=", "owner": "marienz", "repo": "nix-doom-emacs-unstraightened", - "rev": "208eca48a42ac10a1c4e34fa0fc0b875152a840f", + "rev": "5266ed8f5ca477d1734285d236036ab541fc881a", "type": "github" }, "original": { @@ -141,11 +141,11 @@ "doomemacs": { "flake": false, "locked": { - "lastModified": 1758398712, - "narHash": "sha256-Zl5dxGxaUeHV2hnfauGYvH1H5/HNBwSsDwebfZrQumo=", + "lastModified": 1758860516, + "narHash": "sha256-ulQq9+RHIQELZVQuXsLQInqeAhOCDqRltUDRVBjQ1c0=", "owner": "doomemacs", "repo": "doomemacs", - "rev": "c27621a777c11354a4913c7eb455db3766984709", + "rev": "1d1d17e9c910146731cb7b19d5bcbf6c4b283a74", "type": "github" }, "original": { @@ -164,11 +164,11 @@ ] }, "locked": { - "lastModified": 1758420825, - "narHash": "sha256-ADGgTjVUgJfsIxD99WVF05oBrcfyHd6aIkae0JWWS4A=", + "lastModified": 1758938530, + "narHash": "sha256-9mKIivvljlh3WhYPjhJxoKpoJ1+bAh773BeZt1KGYIY=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "ecdeee43fa4e1047496367bfcafff020e1d69d33", + "rev": "0b082e40b028bff0ab5f587105ace1c990fb2129", "type": "github" }, "original": { @@ -380,27 +380,6 @@ "type": "github" } }, - "home-manager_2": { - "inputs": { - "nixpkgs": [ - "zen-browser", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1752603129, - "narHash": "sha256-S+wmHhwNQ5Ru689L2Gu8n1OD6s9eU9n9mD827JNR+kw=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "e8c19a3cec2814c754f031ab3ae7316b64da085b", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "hyprcursor": { "inputs": { "hyprlang": [ @@ -477,11 +456,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1758475676, - "narHash": "sha256-CsScoiBSIVhMFqvhhx9bru4MDAeg1BgOxCby12FqwRA=", + "lastModified": 1759010730, + "narHash": "sha256-Bmdr3SADuZQWfUTyAe3vJK2N3IKMR1kjJqgpza8JAN4=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "26cbc67385d95ba621fe0a125a5b121ffdd09335", + "rev": "766acadcf1e6bfc94fa41ea0d47906c9afca8e24", "type": "github" }, "original": { @@ -691,11 +670,11 @@ ] }, "locked": { - "lastModified": 1758420014, - "narHash": "sha256-a7IGWXPRppgXMRpBosBl2Afr5DICt21ogeZL45uVkX0=", + "lastModified": 1759024631, + "narHash": "sha256-Nubbsc/wql6FOqJXCUmwa7+YPMbUtQjt2YFqqXWMqIU=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "cd931e08409954b2e3595b1532039f8052dd8198", + "rev": "9027055aa1fe6717a3d6e1ce6d46aafa097d803b", "type": "github" }, "original": { @@ -704,6 +683,42 @@ "type": "github" } }, + "nixlib": { + "locked": { + "lastModified": 1736643958, + "narHash": "sha256-tmpqTSWVRJVhpvfSN9KXBvKEXplrwKnSZNAoNPf/S/s=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "1418bc28a52126761c02dd3d89b2d8ca0f521181", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixos-generators": { + "inputs": { + "nixlib": "nixlib", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751903740, + "narHash": "sha256-PeSkNMvkpEvts+9DjFiop1iT2JuBpyknmBUs0Un0a4I=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "032decf9db65efed428afd2fa39d80f7089085eb", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1743576891, @@ -755,11 +770,11 @@ }, "nixpkgs-small": { "locked": { - "lastModified": 1758446528, - "narHash": "sha256-3qYryKrEogFRvVhHGx7uLJUJyp/mSlqnB9m0MqMNCCQ=", + "lastModified": 1758952591, + "narHash": "sha256-LBewTiqEEIslXle4BrkAUlEG7uGvN9mS6G7hY0l04w4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0bfa9141f6fa795b49476562e9991f8034d5c8dc", + "rev": "bd1e762364c6d657a67a05b44a6c04646947e739", "type": "github" }, "original": { @@ -771,11 +786,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1758277210, - "narHash": "sha256-iCGWf/LTy+aY0zFu8q12lK8KuZp7yvdhStehhyX1v8w=", + "lastModified": 1758690382, + "narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8eaee110344796db060382e15d3af0a9fc396e0e", + "rev": "e643668fd71b949c53f8626614b21ff71a07379d", "type": "github" }, "original": { @@ -787,11 +802,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1758346548, - "narHash": "sha256-afXE7AJ7MY6wY1pg/Y6UPHNYPy5GtUKeBkrZZ/gC71E=", + "lastModified": 1758791193, + "narHash": "sha256-F8WmEwFoHsnix7rt290R0rFXNJiMbClMZyIC/e+HYf0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b2a3852bd078e68dd2b3dfa8c00c67af1f0a7d20", + "rev": "25e53aa156d47bad5082ff7618f5feb1f5e02d01", "type": "github" }, "original": { @@ -830,11 +845,11 @@ ] }, "locked": { - "lastModified": 1758492170, - "narHash": "sha256-w0oHCg7d6W46ZQ/QgvbkR6cJ3Lm02B7sk19vzywC5DU=", + "lastModified": 1759037763, + "narHash": "sha256-03rBswReBYcridphYSw4XyVauK1/+3gqFMng3NEq4CA=", "owner": "nix-community", "repo": "nur", - "rev": "c25e04748de8ea4c9c3f09b63df404c1c0aa463b", + "rev": "df3fb235a1e0cd5e6d0907290802a22dde333337", "type": "github" }, "original": { @@ -899,6 +914,7 @@ "hyprland": "hyprland", "jawz-scripts": "jawz-scripts", "nix-gaming": "nix-gaming", + "nixos-generators": "nixos-generators", "nixpkgs": "nixpkgs_2", "nixpkgs-small": "nixpkgs-small", "nixpkgs-unstable": "nixpkgs-unstable", @@ -906,8 +922,7 @@ "nur": "nur", "sops-nix": "sops-nix", "stylix": "stylix", - "ucodenix": "ucodenix", - "zen-browser": "zen-browser" + "ucodenix": "ucodenix" } }, "sops-nix": { @@ -917,11 +932,11 @@ ] }, "locked": { - "lastModified": 1758425756, - "narHash": "sha256-L3N8zV6wsViXiD8i3WFyrvjDdz76g3tXKEdZ4FkgQ+Y=", + "lastModified": 1759030640, + "narHash": "sha256-53VP3BqMXJqD1He1WADTFyUnpta3mie56H7nC59tSic=", "owner": "Mic92", "repo": "sops-nix", - "rev": "e0fdaea3c31646e252a60b42d0ed8eafdb289762", + "rev": "9ac51832c70f2ff34fcc97b05fa74b4a78317f9e", "type": "github" }, "original": { @@ -951,11 +966,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1757957798, - "narHash": "sha256-FT4O5imFJ+FUIGhYj/aFwEEgyvLhuyJ2my8f6mCLtTY=", + "lastModified": 1758752640, + "narHash": "sha256-UYkixkkd3VgoO7NeSlKcaE3Glt1r1FHmBlziwYijgMQ=", "owner": "danth", "repo": "stylix", - "rev": "e6fc25cd12e8f461e402cf34649cc73ad93c7bdd", + "rev": "fdfa65624eed1e28960c24a27ba27fffc92e9a32", "type": "github" }, "original": { @@ -1150,11 +1165,11 @@ "cpu-microcodes": "cpu-microcodes" }, "locked": { - "lastModified": 1757940213, - "narHash": "sha256-mrijoMdIC8m/6dg+jlTeNr0IKgrLgxckrPhf5ibIDSM=", + "lastModified": 1758553579, + "narHash": "sha256-/p9ID64/5G988NDPvfRSjgbV8GdfvJ2el9kz71nrRnU=", "owner": "e-tho", "repo": "ucodenix", - "rev": "6348f12d9ea82e5d8e685fdfd6fd4fc9d8130151", + "rev": "ba7f0a366460e0fbea9622fc770cb982be0e4720", "type": "github" }, "original": { @@ -1203,27 +1218,6 @@ "repo": "xdg-desktop-portal-hyprland", "type": "github" } - }, - "zen-browser": { - "inputs": { - "home-manager": "home-manager_2", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1758482054, - "narHash": "sha256-17OZTXDwwDdH6mxg6IJTivUpuLZCZA7sQbwI6nWsXTQ=", - "owner": "0xc000022070", - "repo": "zen-browser-flake", - "rev": "6a29f6936d26a24f05f6db069ea489b63f7390b2", - "type": "github" - }, - "original": { - "owner": "0xc000022070", - "repo": "zen-browser-flake", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index ec1ce69..42313c9 100644 --- a/flake.nix +++ b/flake.nix @@ -41,8 +41,8 @@ url = "github:nyawox/nixtendo-switch"; inputs.nixpkgs.follows = "nixpkgs"; }; - zen-browser = { - url = "github:0xc000022070/zen-browser-flake"; + nixos-generators = { + url = "github:nix-community/nixos-generators"; inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -58,11 +58,32 @@ inherit system; config.allowUnfree = true; }; - langList = builtins.filter (name: name != "emacs.nix") ( + langList = builtins.filter (name: name != "emacs") ( builtins.map (file: builtins.replaceStrings [ ".nix" ] [ "" ] (baseNameOf file)) ( builtins.attrNames (builtins.readDir ./modules/dev) ) ); + + commonModules = name: [ + { + nixpkgs.overlays = [ + (import ./config/overlay.nix { inherit mkpkgs inputs; }) + inputs.doom-emacs.overlays.default + ]; + } + { + nix.registry = { + jawz.flake = self; + unstable.flake = inputs.nixpkgs-unstable; + }; + } + ./hosts/${name}/configuration.nix + inputs.nur.modules.nixos.default + inputs.sops-nix.nixosModules.sops + inputs.stylix.nixosModules.stylix + inputs.nixtendo-switch.nixosModules.nixtendo-switch + ]; + createConfig = name: local-nixpkgs: let @@ -73,25 +94,7 @@ specialArgs = { inherit inputs outputs; }; - modules = [ - { - nixpkgs.overlays = [ - (import ./config/overlay.nix { inherit mkpkgs inputs; }) - inputs.doom-emacs.overlays.default - ]; - } - { - nix.registry = { - jawz.flake = self; - unstable.flake = inputs.nixpkgs-unstable; - }; - } - ./hosts/${name}/configuration.nix - inputs.nur.modules.nixos.default - inputs.sops-nix.nixosModules.sops - inputs.stylix.nixosModules.stylix - inputs.nixtendo-switch.nixosModules.nixtendo-switch - ]; + modules = commonModules name; }; in { @@ -100,12 +103,22 @@ miniserver = createConfig "miniserver" inputs.nixpkgs-small; server = createConfig "server" inputs.nixpkgs-small; galaxy = createConfig "galaxy" inputs.nixpkgs-small; + emacs = createConfig "emacs" inputs.nixpkgs; + }; + packages.${system} = (jawz-scripts.packages.${system} or { }) // { + emacs-vm = inputs.nixos-generators.nixosGenerate { + inherit system; + specialArgs = { + inherit inputs outputs; + }; + modules = commonModules "emacs"; + format = "vm"; + }; }; - packages.${system} = (jawz-scripts.packages.${system} or { }); devShells.${system} = builtins.listToAttrs ( - map (lang: { - name = lang; - value = self.nixosConfigurations.shell.config.devShells.${lang}; + map (name: { + inherit name; + value = self.nixosConfigurations.emacs.config.devShells.${name}; }) langList ); };