Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
f6ba21e4d8 | |||
6c720bdac6 | |||
6139657197 | |||
e7ec54ef4f |
@ -53,6 +53,7 @@
|
|||||||
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;};
|
||||||
@ -67,7 +68,7 @@
|
|||||||
"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];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
{ config, lib, outputs, pkgs, ... }: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
outputs,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = builtins.attrValues outputs.homeManagerModules;
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
# You can add overlays here
|
# You can add overlays here
|
||||||
overlays = [
|
overlays = [
|
||||||
@ -29,7 +36,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;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
coreutils
|
coreutils
|
||||||
fd
|
fd
|
||||||
|
gcc
|
||||||
htop
|
htop
|
||||||
httpie
|
httpie
|
||||||
jq
|
jq
|
||||||
|
@ -30,7 +30,7 @@ in {
|
|||||||
];
|
];
|
||||||
|
|
||||||
input = {
|
input = {
|
||||||
kb_layout = "de,us";
|
kb_layout = "us";
|
||||||
kb_variant = "";
|
kb_variant = "";
|
||||||
kb_model = "";
|
kb_model = "";
|
||||||
kb_rules = "";
|
kb_rules = "";
|
||||||
|
@ -80,4 +80,27 @@
|
|||||||
|
|
||||||
# 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"
|
||||||
|
"${config.home.homeDirectory}"
|
||||||
|
];
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,9 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nix = {
|
nix = let
|
||||||
|
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
|
||||||
|
in {
|
||||||
settings = {
|
settings = {
|
||||||
experimental-features = "nix-command flakes";
|
experimental-features = "nix-command flakes";
|
||||||
trusted-users = [
|
trusted-users = [
|
||||||
@ -53,10 +55,8 @@
|
|||||||
options = "--delete-older-than 30d";
|
options = "--delete-older-than 30d";
|
||||||
};
|
};
|
||||||
optimise.automatic = true;
|
optimise.automatic = true;
|
||||||
registry =
|
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
|
||||||
(lib.mapAttrs (_: flake: {inherit flake;}))
|
nixPath = ["/etc/nix/path"] ++ lib.mapAttrsToList (flakeName: _: "${flakeName}=flake:${flakeName}") flakeInputs;
|
||||||
((lib.filterAttrs (_: lib.isType "flake")) inputs);
|
|
||||||
nixPath = ["/etc/nix/path"];
|
|
||||||
};
|
};
|
||||||
users.defaultUserShell = pkgs.fish;
|
users.defaultUserShell = pkgs.fish;
|
||||||
}
|
}
|
||||||
|
@ -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,8 +86,10 @@
|
|||||||
# 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. It‘s perfectly fine and recommended to leave
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./echo.nix
|
./echo.nix
|
||||||
|
./httpd.nix
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
56
hosts/m3-kratos/services/containers/httpd.nix
Normal file
56
hosts/m3-kratos/services/containers/httpd.nix
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
3
modules/home-manager/default.nix
Normal file
3
modules/home-manager/default.nix
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
zellij-ps = import ./zellij-ps.nix;
|
||||||
|
}
|
44
modules/home-manager/zellij-ps.nix
Normal file
44
modules/home-manager/zellij-ps.nix
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
@ -1,5 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{pkgs, ...}: {
|
||||||
{
|
|
||||||
# Define your custom packages here
|
# Define your custom packages here
|
||||||
# my-package = pkgs.callPackage ./my-package {};
|
zellij-ps = pkgs.callPackage ./zellij-ps {};
|
||||||
}
|
}
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
# Your custom nix-package
|
|
||||||
# ...
|
|
39
pkgs/zellij-ps/default.nix
Normal file
39
pkgs/zellij-ps/default.nix
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user