1 Commits

Author SHA1 Message Date
1b285bef19 -repl-flakes, fix:homeConfiguration module 2024-11-25 09:45:49 +01:00
21 changed files with 41 additions and 256 deletions

32
flake.lock generated
View File

@ -50,11 +50,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1728922573, "lastModified": 1726524467,
"narHash": "sha256-FegyBabjV4868aJUbvFtqH0zKDEtUpeCAfnB1vWXeBg=", "narHash": "sha256-xkPPPvfHhHK7BNX5ZrQ9N6AIEixCmFzRZHduDf0zv30=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "3b778f10eb275573da9f5c8a7a49e774200b87e5", "rev": "22ee467a54a3ab7fa9d637ccad5330c6c087e9dc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -66,11 +66,11 @@
"dotfiles": { "dotfiles": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1726139078, "lastModified": 1725956275,
"narHash": "sha256-FiyYP/hTiSOkj99P1YcIxc9uJjjInpMPAp6fKtZlkNs=", "narHash": "sha256-4tHKP+PLpJKnFfOT6MY3p/NDBr/3NDyWljB8/iELVZs=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "d9f3a3ba9d8430306a4f6f7e9fd3ad618d274c8e", "rev": "b1393f4b54b8e908b770450ccc49400713d8e457",
"revCount": 2, "revCount": 1,
"type": "git", "type": "git",
"url": "https://code.m3tam3re.com/m3tam3re/dotfiles-flake-demo.git" "url": "https://code.m3tam3re.com/m3tam3re/dotfiles-flake-demo.git"
}, },
@ -107,11 +107,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1726817922, "lastModified": 1712016346,
"narHash": "sha256-gO91NgBTTbVHBlvnn6g6XFeXzJquBH5MrVhYMFTnB0Q=", "narHash": "sha256-O2nO7pD+krq+4HgkLB4VThRtAucIPfXDs/jJqCGlK1w=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "f48b181f0161db6246a1bd1b05d70a7b3a87ab41", "rev": "4be0464472675212654dedf3e021bd5f1d58b92f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -138,11 +138,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1726447378, "lastModified": 1724531977,
"narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", "narHash": "sha256-XROVLf9ti4rrNCFLr+DmXRZtPjCQTW4cYy59owTEmxk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", "rev": "2527da1ef492c495d5391f3bcf9c1dd9f4514e32",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -154,11 +154,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1726463316, "lastModified": 1711703276,
"narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=", "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172", "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -34,6 +34,8 @@
outputs = { outputs = {
self, self,
agenix, agenix,
disko,
dotfiles,
home-manager, home-manager,
nixpkgs, nixpkgs,
... ...
@ -51,7 +53,6 @@
packages = packages =
forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
overlays = import ./overlays {inherit inputs;}; overlays = import ./overlays {inherit inputs;};
homeManagerModules = import ./modules/home-manager;
nixosConfigurations = { nixosConfigurations = {
m3-kratos-vm = nixpkgs.lib.nixosSystem { m3-kratos-vm = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;}; specialArgs = {inherit inputs outputs;};

View File

@ -5,7 +5,6 @@
pkgs, pkgs,
... ...
}: { }: {
imports = builtins.attrValues outputs.homeManagerModules;
nixpkgs = { nixpkgs = {
# You can add overlays here # You can add overlays here
overlays = [ overlays = [

View File

@ -22,7 +22,6 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
coreutils coreutils
fd fd
gcc
htop htop
httpie httpie
jq jq

View File

@ -30,7 +30,7 @@ in {
]; ];
input = { input = {
kb_layout = "us"; kb_layout = "de,us";
kb_variant = ""; kb_variant = "";
kb_model = ""; kb_model = "";
kb_rules = ""; kb_rules = "";

View File

@ -26,8 +26,6 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
kitty kitty
wofi wofi
firefox
n8n
# # Adds the 'hello' command to your environment. It prints a friendly # # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run. # # "Hello, world!" when run.
# pkgs.hello # pkgs.hello
@ -82,26 +80,4 @@
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
programs.zellij-ps = {
enable = true;
projectFolders = [
"${config.home.homeDirectory}/.config"
];
layout = ''
layout {
pane size=1 borderless=true {
plugin location="zellij:tab-bar"
}
pane size="70%" command="nvim"
pane split_direction="vertical" {
pane
pane command="unimatrix"
}
pane size=1 borderless=true {
plugin location="zellij:status-bar"
}
}
'';
};
} }

View File

@ -40,9 +40,7 @@
}; };
}; };
nix = let nix = {
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
settings = { settings = {
experimental-features = "nix-command flakes"; experimental-features = "nix-command flakes";
trusted-users = [ trusted-users = [
@ -55,8 +53,10 @@
options = "--delete-older-than 30d"; options = "--delete-older-than 30d";
}; };
optimise.automatic = true; optimise.automatic = true;
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs; registry =
nixPath = ["/etc/nix/path"] ++ lib.mapAttrsToList (flakeName: _: "${flakeName}=flake:${flakeName}") flakeInputs; (lib.mapAttrs (_: flake: {inherit flake;}))
((lib.filterAttrs (_: lib.isType "flake")) inputs);
nixPath = ["/etc/nix/path"];
}; };
users.defaultUserShell = pkgs.fish; users.defaultUserShell = pkgs.fish;
} }

View File

@ -21,7 +21,7 @@
# Enable networking # Enable networking
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
networking.networkmanager.unmanaged = ["interface-name:ve-*"];
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
@ -86,15 +86,13 @@
# networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether. # Or disable the firewall altogether.
networking.nat.enable = true;
networking.nat.internalInterfaces = ["ve-+"];
networking.nat.externalInterface = "enp1s0";
# networking.firewall.enable = false; # networking.firewall.enable = false;
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave # on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system. # this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.11"; # Did you read the comment? system.stateVersion = "24.05"; # Did you read the comment?
} }

View File

@ -1,7 +1,6 @@
{ {
imports = [ imports = [
./echo.nix ./echo.nix
./httpd.nix
./nginx.nix ./nginx.nix
]; ];
} }

View File

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

View File

@ -1,56 +0,0 @@
{
containers.httpd = {
autoStart = true;
ephemeral = true;
privateNetwork = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.11";
forwardPorts = [
{
containerPort = 80;
hostPort = 80;
}
];
config = {...}: {
services.httpd = {
enable = true;
adminAddr = "foo@example.org";
};
networking.firewall.allowedTCPPorts = [80];
system.stateVersion = "24.05";
};
bindMounts = {
"/root/data" = {
hostPath = "/home/m3tam3re/data/";
isReadOnly = false;
};
};
};
containers.httpd2 = {
autoStart = true;
ephemeral = true;
privateNetwork = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.12";
forwardPorts = [
{
containerPort = 80;
hostPort = 8080;
}
];
config = {...}: {
services.httpd = {
enable = true;
adminAddr = "foo@example.org";
};
networking.firewall.allowedTCPPorts = [80];
system.stateVersion = "24.05";
};
bindMounts = {
"/root/data" = {
hostPath = "/home/m3tam3re/data/";
isReadOnly = false;
};
};
};
}

View File

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

View File

@ -1,11 +0,0 @@
{
services.n8n = {
enable = true;
openFirewall = true;
};
systemd.services.n8n = {
environment = {
N8N_SECURE_COOKIE = "false";
};
};
}

View File

@ -1,3 +0,0 @@
{
zellij-ps = import ./zellij-ps.nix;
}

View File

@ -1,44 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.programs.zellij-ps;
in {
options = {
programs.zellij-ps = {
enable = mkEnableOption "Zellij Project Selector";
projectFolders = lib.mkOption {
type = lib.types.listOf lib.types.path;
description = "List of project folders for zellij-ps.";
default = ["${config.home.homeDirectory}/projects"];
};
layout = lib.mkOption {
type = lib.types.str;
description = "Layout for zellij";
default = ''
layout {
pane size=1 borderless=true {
plugin location="zellij:tab-bar"
}
pane
pane split_direction="vertical" {
pane
pane command="htop"
}
pane size=2 borderless=true {
plugin location="zellij:status-bar"
}
}
'';
};
};
};
config = mkIf cfg.enable {
home.packages = [pkgs.zellij-ps];
home.sessionVariables.PROJECT_FOLDERS = lib.concatStringsSep ":" cfg.projectFolders;
home.file.".config/zellij/layouts/zellij-ps.kdl".text = cfg.layout;
};
}

View File

@ -1,13 +1,16 @@
{inputs, ...}: { { inputs, ... }: {
# This one brings our custom packages from the 'pkgs' directory # This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs {pkgs = final;}; additions = final: _prev: import ../pkgs { pkgs = final; };
# This one contains whatever you want to overlay # This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really. # You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays # https://nixos.wiki/wiki/Overlays
modifications = final: prev: { modifications = final: prev:
n8n = import ./mods/n8n.nix {inherit prev;}; {
}; # example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });
};
stable-packages = final: _prev: { stable-packages = final: _prev: {
stable = import inputs.nixpkgs-stable { stable = import inputs.nixpkgs-stable {

View File

@ -1,17 +0,0 @@
{prev}:
prev.n8n.overrideAttrs (oldAttrs: rec {
pname = oldAttrs.pname;
version = "1.63.0";
src = prev.fetchFromGitHub {
owner = "n8n-io";
repo = "n8n";
rev = "n8n@${version}";
hash = "sha256-zJHveCbBPJs8qbgCsU+dgucoXpAKa7PVLH4tfdcJZlE=";
};
pnpmDeps = prev.pnpm.fetchDeps {
inherit pname version src;
hash = "sha256-FsBA/QENfreCJnYCw8MnX5W2D+WJ3DUuTIakH78TYU8=";
};
})

View File

@ -1,5 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
# Define your custom packages here # Define your custom packages here
zellij-ps = pkgs.callPackage ./zellij-ps {}; # my-package = pkgs.callPackage ./my-package {};
n8n-custom = pkgs.callPackage ./n8n-custom {};
} }

View File

@ -0,0 +1,2 @@
# Your custom nix-package
# ...

View File

@ -1,21 +0,0 @@
{
fetchFromGitHub,
n8n,
pnpm,
}:
n8n.overrideAttrs (oldAttrs: rec {
pname = oldAttrs.pname;
version = "1.63.0";
src = fetchFromGitHub {
owner = "n8n-io";
repo = "n8n";
rev = "n8n@${version}";
hash = "sha256-zJHveCbBPJs8qbgCsU+dgucoXpAKa7PVLH4tfdcJZlE=";
};
pnpmDeps = pnpm.fetchDeps {
inherit pname version src;
hash = "sha256-FsBA/QENfreCJnYCw8MnX5W2D+WJ3DUuTIakH78TYU8=";
};
})

View File

@ -1,39 +0,0 @@
{
lib,
fish,
fd,
fzf,
makeWrapper,
zellij,
fetchFromGitea,
stdenv,
}:
stdenv.mkDerivation {
pname = "zellij-ps";
version = "0.1.0";
src = fetchFromGitea {
domain = "code.m3tam3re.com";
owner = "m3tam3re";
repo = "helper-scripts";
rev = "08a3217b83391c1110545c1ee3161eecd5dbe5e9";
sha256 = "1sc4i58mwcg3qsq0wwl5rvk08ykbxc497bq7mrxiirndsarskby7";
};
buildInputs = [];
nativeBuildInputs = [makeWrapper];
installPhase = ''
mkdir -p $out/bin
cp zellij-ps.fish $out/bin/zellij-ps
wrapProgram $out/bin/zellij-ps \
--prefix PATH : ${lib.makeBinPath [fish fd fzf zellij]}
'';
meta = with lib; {
description = "A small project script for zellij";
homepage = "https://code.m3tam3re.com/m3tam3re/helper-scripts";
license = licenses.mit;
maintainers = with maintainers; [m3tam3re];
platforms = platforms.unix;
};
}