lotsa stuff again

This commit is contained in:
CherryKitten 2024-05-04 12:03:59 +02:00
parent ed3a2803c7
commit 4a65423961
Signed by: sammy
GPG key ID: 98D8F75FB0658276
22 changed files with 149 additions and 131 deletions

View file

@ -66,11 +66,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"lastModified": 1714641030,
"narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e",
"type": "github"
},
"original": {
@ -119,11 +119,11 @@
]
},
"locked": {
"lastModified": 1712386041,
"narHash": "sha256-dA82pOMQNnCJMAsPG7AXG35VmCSMZsJHTFlTHizpKWQ=",
"lastModified": 1714043624,
"narHash": "sha256-Xn2r0Jv95TswvPlvamCC46wwNo8ALjRCMBJbGykdhcM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d6bb9f934f2870e5cbc5b94c79e9db22246141ff",
"rev": "86853e31dc1b62c6eeed11c667e8cdd0285d4411",
"type": "github"
},
"original": {
@ -135,11 +135,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1713344939,
"narHash": "sha256-jpHkAt0sG2/J7ueKnG7VvLLkBYUMQbXQ2L8OBpVG53s=",
"lastModified": 1714531828,
"narHash": "sha256-ILsf3bdY/hNNI/Hu5bSt2/KbmHaAVhBbNUOdGztTHEg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e402c3eb6d88384ca6c52ef1c53e61bdc9b84ddd",
"rev": "0638fe2715d998fa81d173aad264eb671ce2ebc1",
"type": "github"
},
"original": {
@ -150,29 +150,23 @@
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1711703276,
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
"type": "github"
"lastModified": 1714640452,
"narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1713562564,
"narHash": "sha256-NQpYhgoy0M89g9whRixSwsHb8RFIbwlxeYiVSDwSXJg=",
"lastModified": 1714656196,
"narHash": "sha256-kjQkA98lMcsom6Gbhw8SYzmwrSo+2nruiTcTZp5jK7o=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "92d295f588631b0db2da509f381b4fb1e74173c5",
"rev": "94035b482d181af0a0f8f77823a790b256b7c3cc",
"type": "github"
},
"original": {

View file

@ -56,6 +56,25 @@
flake =
{
nixosModules = builtins.listToAttrs (
map
(x: {
name = x;
value = import (./modules/nixos + "/${x}");
})
(builtins.attrNames (builtins.readDir ./modules/nixos))
);
homeManagerModules = builtins.listToAttrs (
map
(name: {
inherit name;
value = import (./modules/home + "/${name}");
})
(builtins.attrNames (builtins.readDir ./modules/home))
);
packages.x86_64-linux.iso = self.nixosConfigurations.iso.config.system.build.isoImage;
homeConfigurations =
@ -67,6 +86,7 @@
modules = [ ./users/${name}/home.nix ];
extraSpecialArgs = {
inherit inputs;
flake = self;
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
};
});

View file

@ -16,13 +16,19 @@ in
description = "All my NixoS machines";
specialArgs = {
inherit inputs outputs pkgs-unstable;
flake = self;
nodes = colmenaHive.nodes;
};
nixpkgs = pkgs;
};
defaults = { lib, config, name, nodes, ... }: {
imports = [ ./hosts/${name} ./profiles/base (import ./overlays) ];
imports = [
./hosts/${name}
./profiles/base
(import ./overlays)
inputs.home-manager.nixosModules.home-manager
] ++ builtins.attrValues self.nixosModules;
options.cherrykitten = {
primaryIPv4 = lib.mkOption {
@ -45,8 +51,13 @@ in
networking.hostName = name;
networking.domain = "cherrykitten.xyz";
deployment = {
targetUser = lib.mkDefault "sammy";
tags = [ pkgs.stdenv.hostPlatform.system ];
};
home-manager.extraSpecialArgs = {
inherit inputs outputs pkgs-unstable;
flake = self;
};
};
};

View file

@ -1,11 +0,0 @@
{ ... }: {
imports = [
./fish
./nvim
./tmux.nix
./starship.nix
./git.nix
./foot.nix
./ssh.nix
];
}

View file

@ -1,19 +1,23 @@
{ ... }: {
programs.fish = {
enable = true;
{ lib, ... }: {
options.cherrykitten.fish = {
enable = lib.mkEnableOption "Fish Shell";
} // { default = true; };
config = {
programs.fish = {
enable = true;
interactiveShellInit = ''
set -g fish_greeting
set -g fish_key_bindings fish_vi_key_bindings
interactiveShellInit = ''
set -g fish_greeting
set -g fish_key_bindings fish_vi_key_bindings
set -x GPG_TTY (tty)
gpgconf --launch gpg-agent
gpg-connect-agent updatestartuptty /bye > /dev/null
'';
set -x GPG_TTY (tty)
gpgconf --launch gpg-agent
gpg-connect-agent updatestartuptty /bye > /dev/null
'';
shellAliases = {
g = "git";
shellAliases = {
g = "git";
};
};
};
}

View file

@ -1,38 +0,0 @@
{ ... }:
{
programs.foot = {
enable = true;
settings = {
main = {
font = "monospace:size=8";
dpi-aware = "yes";
initial-window-size-pixels = "1920x1080";
};
bell.visual = "yes";
# colors taken from https://codeberg.org/dnkl/foot/src/branch/master/themes/catppuccin
cursor.color = "1A1826 D9E0EE";
colors = {
foreground = "D9E0EE";
background = "1E1D2F";
regular0 = "6E6C7E";
regular1 = "F28FAD";
regular2 = "ABE9B3";
regular3 = "FAE3B0";
regular4 = "96CDFB";
regular5 = "F5C2E7";
regular6 = "89DCEB";
regular7 = "D9E0EE";
bright0 = "988BA2";
bright1 = "F28FAD";
bright2 = "ABE9B3";
bright3 = "FAE3B0";
bright4 = "96CDFB";
bright5 = "F5C2E7";
bright6 = "89DCEB";
bright7 = "D9E0EE";
};
};
};
}

View file

@ -0,0 +1,43 @@
{ lib, ... }:
{
options.cherrykitten.foot = {
enable = lib.mkEnableOption "Foot Terminal Emulator";
} // { default = true; };
config = {
programs.foot = {
enable = true;
settings = {
main = {
font = "monospace:size=8";
dpi-aware = "yes";
initial-window-size-pixels = "1920x1080";
};
bell.visual = "yes";
# colors taken from https://codeberg.org/dnkl/foot/src/branch/master/themes/catppuccin
cursor.color = "1A1826 D9E0EE";
colors = {
foreground = "D9E0EE";
background = "1E1D2F";
regular0 = "6E6C7E";
regular1 = "F28FAD";
regular2 = "ABE9B3";
regular3 = "FAE3B0";
regular4 = "96CDFB";
regular5 = "F5C2E7";
regular6 = "89DCEB";
regular7 = "D9E0EE";
bright0 = "988BA2";
bright1 = "F28FAD";
bright2 = "ABE9B3";
bright3 = "FAE3B0";
bright4 = "96CDFB";
bright5 = "F5C2E7";
bright6 = "89DCEB";
bright7 = "D9E0EE";
};
};
};
};
}

View file

View file

@ -42,9 +42,9 @@ in
".cache"
".git"
];
environmentFile = "/root/keys/restic_env";
repositoryFile = "/root/keys/restic_repository_file";
passwordFile = "/root/keys/restic_password_file";
environmentFile = config.deployment.keys."restic_env".path;
repositoryFile = config.deployment.keys."restic_repository_file".path;
passwordFile = config.deployment.keys."restic_password_file".path;
};
};
};

View file

@ -1,3 +0,0 @@
{ ... }: {
imports = [ ./backups ];
}

View file

@ -1,30 +1,7 @@
{ config, pkgs, lib, ... }:
{ ... }:
{
nixpkgs.overlays = [
(final: prev: {
gotosocial =
let
web-assets = prev.fetchurl {
url = "https://github.com/superseriousbusiness/gotosocial/releases/download/v0.15.0/gotosocial_0.15.0_web-assets.tar.gz";
hash = "sha256-vrSdFIdBcfj6+sxtvv1s/Mu85I1mKxjyUYS902oLKk4=";
};
in
prev.gotosocial.overrideAttrs {
version = "0.15.0";
doCheck = false;
src = prev.fetchFromGitHub {
owner = "superseriousbusiness";
repo = "gotosocial";
rev = "refs/tags/v0.15.0";
hash = "sha256-z0iETddkw4C2R6ig9ZO8MTvhuWnmQ37/6q3oZ4WAzd4=";
};
postInstall = ''
tar xf ${web-assets}
mkdir -p $out/share/gotosocial
mv web $out/share/gotosocial/
'';
};
})
(import ./gotosocial.nix)
];
}

24
overlays/gotosocial.nix Normal file
View file

@ -0,0 +1,24 @@
final: prev: {
gotosocial =
let
web-assets = prev.fetchurl {
url = "https://github.com/superseriousbusiness/gotosocial/releases/download/v0.15.0/gotosocial_0.15.0_web-assets.tar.gz";
hash = "sha256-vrSdFIdBcfj6+sxtvv1s/Mu85I1mKxjyUYS902oLKk4=";
};
in
prev.gotosocial.overrideAttrs {
version = "0.15.0";
doCheck = false;
src = prev.fetchFromGitHub {
owner = "superseriousbusiness";
repo = "gotosocial";
rev = "refs/tags/v0.15.0";
hash = "sha256-z0iETddkw4C2R6ig9ZO8MTvhuWnmQ37/6q3oZ4WAzd4=";
};
postInstall = ''
tar xf ${web-assets}
mkdir -p $out/share/gotosocial
mv web $out/share/gotosocial/
'';
};
}

View file

@ -2,12 +2,8 @@
imports = [
../../users/root
../../users/sammy
../../modules/nixos
inputs.home-manager.nixosModules.home-manager
];
deployment.tags = [ pkgs.stdenv.hostPlatform.system ];
deployment.targetUser = lib.mkDefault "sammy";
nix = {
settings = {
@ -82,6 +78,7 @@
enable = lib.mkDefault true;
maxretry = 5;
};
services.udev.packages = with pkgs; [ libu2f-host yubikey-personalization ];
programs.gnupg.agent = {

View file

@ -44,7 +44,7 @@
home-manager.users.nixos = {
imports = [
../../modules/home/foot.nix
../../modules/home/foot
];
home.stateVersion = "23.11";

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ pkgs, lib, config, ... }:
{
deployment.keys."root_password_hash" = {
keyCommand = [ "pass" "users/root/hashedPassword" ];
@ -6,7 +6,7 @@
users.users.root = {
shell = pkgs.fish;
hashedPasswordFile = lib.mkDefault "/run/keys/root_password_hash";
hashedPasswordFile = lib.mkDefault config.deployment.keys."root_password_hash".path;
};
home-manager.users.root = import ./home.nix;

View file

@ -1,5 +1,5 @@
{ ... }: {
imports = [ ../../modules/home ];
{ flake, ... }: {
imports = (builtins.attrValues flake.homeManagerModules);
home.stateVersion = "23.11"; # Please read the comment before changing.

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ pkgs, lib, config, ... }:
{
deployment.keys."sammy_password_hash" = {
destDir = "/home/sammy/.keys";
@ -10,7 +10,7 @@
extraGroups = [ "networkmanager" "wheel" "docker" ];
shell = pkgs.fish;
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJZyQSZw+pExsx2RXB+yxbaJGB9mtvudbQ/BP7E1yKvr openpgp:0x6068FEBB" ];
hashedPasswordFile = lib.mkDefault "/home/sammy/.keys/sammy_password_hash";
hashedPasswordFile = lib.mkDefault config.deployment.keys."sammy_password_hash".path;
};
home-manager.users.sammy = import ./home.nix;

View file

@ -1,5 +1,5 @@
{ ... }: {
imports = [ ../../modules/home ];
{ flake, ... }: {
imports = (builtins.attrValues flake.homeManagerModules);
programs.git = {
userName = "CherryKitten";