Compare commits
2 Commits
cc48ba10d6
...
exports
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbc3741fca | ||
| 88b6f01a35 |
28
flake.nix
28
flake.nix
@@ -10,31 +10,24 @@
|
|||||||
let
|
let
|
||||||
inherit (self) outputs;
|
inherit (self) outputs;
|
||||||
nixosSystem = inputs.nixpkgs.lib.nixosSystem;
|
nixosSystem = inputs.nixpkgs.lib.nixosSystem;
|
||||||
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
|
||||||
|
|
||||||
# Base LXC module that can be reused
|
|
||||||
baseLxcModule = { pkgs, ... }: {
|
|
||||||
system.stateVersion = "24.11";
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
services.vscode-server.enable = true;
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
git
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Define the base modules list once
|
# Define the base modules list once
|
||||||
baseLxcModules = [
|
baseLxcModules = [
|
||||||
(inputs.nixpkgs + "/nixos/modules/virtualisation/proxmox-lxc.nix")
|
(inputs.nixpkgs + "/nixos/modules/virtualisation/proxmox-lxc.nix")
|
||||||
inputs.vscode-server.nixosModules.default
|
inputs.vscode-server.nixosModules.default
|
||||||
baseLxcModule
|
({ pkgs, ... }: {
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
services.vscode-server.enable = true;
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
];
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
# Function to create LXC systems with custom modules
|
# Function to create LXC systems with custom modules
|
||||||
mkLxcSystem = { system ? "x86_64-linux", extraModules ? [], extraPackages ? [] }: nixosSystem {
|
mkLxcSystem = { system ? "x86_64-linux", extraModules ? [], extraPackages ? [] }: nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = {
|
|
||||||
inherit pkgs;
|
|
||||||
};
|
|
||||||
modules = baseLxcModules ++ extraModules ++ [
|
modules = baseLxcModules ++ extraModules ++ [
|
||||||
# Add extra packages to the base configuration
|
# Add extra packages to the base configuration
|
||||||
({ pkgs, ... }: {
|
({ pkgs, ... }: {
|
||||||
@@ -52,7 +45,6 @@
|
|||||||
|
|
||||||
# Export nixosModules for use in other flakes
|
# Export nixosModules for use in other flakes
|
||||||
nixosModules = {
|
nixosModules = {
|
||||||
lxc-base = baseLxcModule;
|
|
||||||
# Alternative module with more options
|
# Alternative module with more options
|
||||||
lxc-configurable = { config, lib, pkgs, ... }:
|
lxc-configurable = { config, lib, pkgs, ... }:
|
||||||
with lib;
|
with lib;
|
||||||
|
|||||||
Reference in New Issue
Block a user