3 Commits

Author SHA1 Message Date
71ef79dd52 -repl-flakes, fix:homeConfiguration module 2024-11-25 09:43:33 +01:00
b2c3dba781 video8 2024-09-21 16:59:39 +02:00
6a0334cd38 +disko 2024-09-17 14:28:40 +02:00
15 changed files with 160 additions and 27 deletions

21
flake.lock generated
View File

@ -1,5 +1,25 @@
{ {
"nodes": { "nodes": {
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1726524467,
"narHash": "sha256-xkPPPvfHhHK7BNX5ZrQ9N6AIEixCmFzRZHduDf0zv30=",
"owner": "nix-community",
"repo": "disko",
"rev": "22ee467a54a3ab7fa9d637ccad5330c6c087e9dc",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"dotfiles": { "dotfiles": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -70,6 +90,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko",
"dotfiles": "dotfiles", "dotfiles": "dotfiles",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",

View File

@ -18,6 +18,11 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
dotfiles = { dotfiles = {
url = "git+https://code.m3tam3re.com/m3tam3re/dotfiles-flake-demo.git"; url = "git+https://code.m3tam3re.com/m3tam3re/dotfiles-flake-demo.git";
flake = false; flake = false;
@ -26,6 +31,7 @@
outputs = { outputs = {
self, self,
disko,
dotfiles, dotfiles,
home-manager, home-manager,
nixpkgs, nixpkgs,
@ -47,14 +53,17 @@
nixosConfigurations = { nixosConfigurations = {
m3-kratos-vm = nixpkgs.lib.nixosSystem { m3-kratos-vm = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;}; specialArgs = {inherit inputs outputs;};
modules = [./hosts/m3-kratos]; modules = [
./hosts/m3-kratos
inputs.disko.nixosModules.disko
];
}; };
}; };
homeConfigurations = { homeConfigurations = {
"m3tam3re@m3-kratos-vm" = home-manager.lib.homeManagerConfiguration { "m3tam3re@m3-kratos-vm" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux"; pkgs = nixpkgs.legacyPackages."x86_64-linux";
extraSpecialArgs = {inherit inputs outputs;}; extraSpecialArgs = {inherit inputs outputs;};
modules = [./home/m3tam3re/m3tam3re.nix]; modules = [./home/m3tam3re/m3-kratos.nix];
}; };
}; };
}; };

View File

@ -1,4 +1,10 @@
{ config, lib, outputs, pkgs, ... }: { {
config,
lib,
outputs,
pkgs,
...
}: {
nixpkgs = { nixpkgs = {
# You can add overlays here # You can add overlays here
overlays = [ overlays = [
@ -29,7 +35,7 @@
nix = { nix = {
package = lib.mkDefault pkgs.nix; package = lib.mkDefault pkgs.nix;
settings = { settings = {
experimental-features = [ "nix-command" "flakes" "repl-flake" ]; experimental-features = ["nix-command" "flakes"];
warn-dirty = false; warn-dirty = false;
}; };
}; };

View File

@ -7,6 +7,7 @@
... ...
}: { }: {
imports = [ imports = [
./extraServices
./users ./users
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
]; ];

View File

@ -0,0 +1,5 @@
{
imports = [
./podman.nix
];
}

View File

@ -0,0 +1,32 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.extraServices.podman;
in {
options.extraServices.podman.enable = mkEnableOption "enable podman";
config = mkIf cfg.enable {
virtualisation = {
podman = {
enable = true;
dockerCompat = true;
autoPrune = {
enable = true;
dates = "weekly";
flags = [
"--filter=until=24h"
"--filter=label!=important"
];
};
defaultNetwork.settings.dns_enabled = true;
};
};
environment.systemPackages = with pkgs; [
podman-compose
];
};
}

View File

@ -1 +0,0 @@
../../../home/m3tam3re

View File

@ -26,5 +26,5 @@
packages = [inputs.home-manager.packages.${pkgs.system}.default]; packages = [inputs.home-manager.packages.${pkgs.system}.default];
}; };
home-manager.users.m3tam3re = home-manager.users.m3tam3re =
import m3tam3re/${config.networking.hostName}.nix; import ../../../home/m3tam3re/${config.networking.hostName}.nix;
} }

View File

@ -4,13 +4,13 @@
{pkgs, ...}: { {pkgs, ...}: {
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./disko-config.nix
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
# Bootloader. # Bootloader.
boot.loader.grub.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.grub.device = "/dev/vda"; boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub.useOSProber = true;
networking.hostName = "m3-kratos"; # Define your hostname. networking.hostName = "m3-kratos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.

View File

@ -33,5 +33,11 @@
#:w #:w
# networking.hostName = "nixos"; # Define your hostname. # networking.hostName = "nixos"; # Define your hostname.
{ {
imports = [../common ./configuration.nix]; imports = [
../common
./configuration.nix
./services
];
extraServices.podman.enable = true;
} }

View File

@ -0,0 +1,36 @@
{
disko.devices = {
disk = {
nixos = {
type = "disk";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
}

View File

@ -1,24 +1,21 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/profiles/qemu-guest.nix") lib,
]; pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk"];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/b3fbba01-1206-44d9-9b15-72e6313b4f72";
fsType = "ext4";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's
@ -29,4 +26,3 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
} }

View File

@ -0,0 +1,5 @@
{
imports = [
./echo.nix
];
}

View File

@ -0,0 +1,12 @@
{lib, ...}: {
virtualisation.oci-containers.containers."echo-http-service" = {
image = "hashicorp/http-echo";
extraOptions = ["-text='Hello, World!'" "--network=web"];
ports = ["5678:5678"];
};
system.activationScripts.createPodmanNetworkWeb = lib.mkAfter ''
if ! /run/current-system/sw/bin/podman network exists web; then
/run/current-system/sw/bin/podman network create web
fi
'';
}

View File

@ -0,0 +1,5 @@
{
imports = [
./containers
];
}