Files
lxc-bootstrap/flake.nix
2025-06-03 04:48:13 +00:00

56 lines
1.8 KiB
Nix

{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
vscode-server.url = "github:nix-community/nixos-vscode-server";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, ... }@args:
let
inherit (self) outputs;
nixosSystem = args.nixpkgs.lib.nixosSystem;
pkgs = args.nixpkgs.legacyPackages.x86_64-linux;
in
{
nixosConfigurations.lxc = nixosSystem {
system = "x86_64-linux";
modules = [
(args.nixpkgs + "/nixos/modules/virtualisation/proxmox-lxc.nix")
args.vscode-server.nixosModules.default
({ config, pkgs, ... }: {
system.stateVersion = "24.11";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
services.vscode-server.enable = true;
virtualisation.docker.enable = true;
environment.systemPackages = with pkgs; [
git
devenv
(pkgs.writeShellScriptBin "nfs" ''
sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#lxc --impure
'')
(pkgs.writeShellScriptBin "nfsu" ''
FLAKE=$(readlink -f /etc/nixos)
nix flake update --flake $FLAKE --impure
git -C /etc/nixos add $FLAKE/flake.lock > /dev/null 2>&1
sudo nixos-rebuild switch --flake $FLAKE#lxc --impure
'')
];
})
args.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.users.root = {
home.stateVersion = "24.11";
imports = [ ./git.nix ];
};
}
];
};
};
}