flake for emacs vm
This commit is contained in:
65
flake.nix
65
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
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user