Compare commits

..

1 Commits

Author SHA1 Message Date
Jonas Röger 37589de341 Home Gen23 @ 2026-04-15-16:12 by admin-jroeger@T14-OE130-7-ubuntu 2026-04-15 16:12:21 +02:00
33 changed files with 69 additions and 569 deletions
Generated
+43 -96
View File
@@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1781152676,
"narHash": "sha256-RxWs5ND31KzTG7wvMM+PMfUjyNpmIEr999lqNARaM5o=",
"lastModified": 1773889306,
"narHash": "sha256-PAqwnsBSI9SVC2QugvQ3xeYCB0otOwCacB1ueQj2tgw=",
"owner": "nix-community",
"repo": "disko",
"rev": "ff8702b4de27f72b4c78573dfb89ec74e36abdf1",
"rev": "5ad85c82cc52264f4beddc934ba57f3789f28347",
"type": "github"
},
"original": {
@@ -48,11 +48,11 @@
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1781409739,
"narHash": "sha256-6dadOVlqPpjy0w4WuwvX+Qx0Kkaabm3tahMrCrr72Rg=",
"lastModified": 1774690660,
"narHash": "sha256-oMALw/szOKhCXVX00pmITjcHorWPWu2jLRYiV1sWHnI=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "ef56de5faccb3ac59d95aa31cce551ff72e35bed",
"rev": "f4fc55e8011f82a9e0d66c610c1bec5274751b10",
"type": "gitlab"
},
"original": {
@@ -83,11 +83,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1778716662,
"narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
"lastModified": 1772408722,
"narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
"rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3",
"type": "github"
},
"original": {
@@ -103,27 +103,27 @@
]
},
"locked": {
"lastModified": 1781319724,
"narHash": "sha256-ZGuxexEMo4Xv28KJ0dX/m/PHN4oZIOnxHZpNTyrvx4M=",
"lastModified": 1774559029,
"narHash": "sha256-deix7yg3j6AhjMPnFDCmWB3f83LsajaaULP5HH2j34k=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "8355f0a16b2dbb06a97959a918af5b239bbe05ae",
"rev": "a0bb0d11514f92b639514220114ac8063c72d0a3",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-26.05",
"ref": "release-25.11",
"repo": "home-manager",
"type": "github"
}
},
"import-tree": {
"locked": {
"lastModified": 1778781969,
"narHash": "sha256-Jjuz5CmSkur8KvLDoGa+vylEp+RkQtv4mt/qcMznpH0=",
"lastModified": 1773693634,
"narHash": "sha256-BtZ2dtkBdSUnFPPFc+n0kcMbgaTxzFNPv2iaO326Ffg=",
"owner": "vic",
"repo": "import-tree",
"rev": "d321337efd0f23a9eb14a42adb7b2c29313ab274",
"rev": "c41e7d58045f9057880b0d85e1152d6a4430dbf1",
"type": "github"
},
"original": {
@@ -141,11 +141,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1780375694,
"narHash": "sha256-TznzgYVONg28KiSFB2rVdf/eLVIMtEQOxKt13Kzyrp8=",
"lastModified": 1774666183,
"narHash": "sha256-3DNpGXzkyuIu3/gXNtLvB2oSqKY5z1QP5ajy3VZjVV0=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "e6f8bec35104ca5955efe73742da58d2823684f7",
"rev": "7bcbe84d765e7fce5e267c569c718d8246336f3b",
"type": "github"
},
"original": {
@@ -155,15 +155,12 @@
}
},
"nixos-hardware": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1781168557,
"narHash": "sha256-LOnLQ2tpYF9gqIDDr3+j3DbpJJr/QCH6zPRT2GzEUOE=",
"lastModified": 1774567711,
"narHash": "sha256-uVlOHBvt6Vc/iYNJXLPa4c3cLXwMllOCVfAaLAcphIo=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "6358ff76821101c178e3ab4919a62799bfe3652e",
"rev": "3f6f874dfc34d386d10e434c48ad966c4832243e",
"type": "github"
},
"original": {
@@ -175,24 +172,27 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1767892417,
"narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=",
"rev": "3497aa5c9457a9d88d71fa93a4a8368816fbeeba",
"type": "tarball",
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.05pre924538.3497aa5c9457/nixexprs.tar.xz"
"lastModified": 1774388614,
"narHash": "sha256-tFwzTI0DdDzovdE9+Ras6CUss0yn8P9XV4Ja6RjA+nU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "1073dad219cb244572b74da2b20c7fe39cb3fa9e",
"type": "github"
},
"original": {
"type": "tarball",
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
"owner": "nixos",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1777168982,
"narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=",
"lastModified": 1772328832,
"narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14",
"rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742",
"type": "github"
},
"original": {
@@ -203,11 +203,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1781074563,
"narHash": "sha256-md8WlXOlfnIeHeOScMTTHFyf2d6iaTwPl2apR5EQ3P4=",
"lastModified": 1774386573,
"narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9ae611a455b90cf061d8f332b977e387bda8e1ca",
"rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9",
"type": "github"
},
"original": {
@@ -217,22 +217,6 @@
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1781216227,
"narHash": "sha256-9mUW6gNwoN2SWc/l0fW4svPNOulXLl8ijqKyeSOGgJE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a0374025a863d007d98e3297f6aa46cc3141c2f0",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-26.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"disko": "disko",
@@ -243,10 +227,9 @@
"import-tree": "import-tree",
"nix-minecraft": "nix-minecraft",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"sops-nix": "sops-nix",
"spicetify-nix": "spicetify-nix"
"sops-nix": "sops-nix"
}
},
"sops-nix": {
@@ -256,11 +239,11 @@
]
},
"locked": {
"lastModified": 1780547341,
"narHash": "sha256-Gq8KNx5A7hBB3uGJaj6eQfLDIz5YdLu92gqBcvHvoUo=",
"lastModified": 1774303811,
"narHash": "sha256-fhG4JAcLgjKwt+XHbjs8brpWnyKUfU4LikLm3s0Q/ic=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "9ed65852b6257fbeae4355bc24ecfea307ca759a",
"rev": "614e256310e0a4f8a9ccae3fa80c11844fba7042",
"type": "github"
},
"original": {
@@ -269,27 +252,6 @@
"type": "github"
}
},
"spicetify-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_2"
},
"locked": {
"lastModified": 1781425310,
"narHash": "sha256-GTBka4Df/ZOacmisI/DI2LICyNChEqn/giah83LucdM=",
"owner": "Gerg-L",
"repo": "spicetify-nix",
"rev": "aeaf7c81a45d3761da61cb05bfc370ac6d1b0441",
"type": "github"
},
"original": {
"owner": "Gerg-L",
"repo": "spicetify-nix",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
@@ -304,21 +266,6 @@
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
+2 -4
View File
@@ -2,13 +2,13 @@
description = "Nixos config flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
import-tree.url = "github:vic/import-tree";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
@@ -27,8 +27,6 @@
};
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
nix-minecraft.inputs.nixpkgs.follows = "nixpkgs";
spicetify-nix.url = "github:Gerg-L/spicetify-nix";
spicetify-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {
+1 -1
View File
@@ -36,7 +36,7 @@ in {
programs.borgmatic.backups = {
workspaces = {
location = {
sourceDirectories = ["${config.xdg.userDirs.extraConfig.WORKSPACES}"];
sourceDirectories = ["${config.xdg.userDirs.extraConfig.XDG_WORKSPACES_DIR}"];
repositories = [repo];
excludeHomeManagerSymlinks = true;
extraConfig = {
+3 -4
View File
@@ -46,12 +46,11 @@
};
};
xdg.userDirs.enable = true;
xdg.userDirs.setSessionVariables = true;
xdg.userDirs.createDirectories = true;
xdg.userDirs.extraConfig = {
WORKSPACES = "${config.home.homeDirectory}/Workspaces";
NEXTCLOUD = "${config.home.homeDirectory}/Nextcloud";
NOTES = "${config.home.homeDirectory}/Notes";
XDG_WORKSPACES_DIR = "${config.home.homeDirectory}/Workspaces";
XDG_NEXTCLOUD_DIR = "${config.home.homeDirectory}/Nextcloud";
XDG_NOTES_DIR = "${config.home.homeDirectory}/Notes";
};
# This value determines the Home Manager release that your configuration is
+1 -1
View File
@@ -6,7 +6,7 @@
flake.homeConfigurations."jonas@comfy-station" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs {system = "x86_64-linux";};
modules = [
({...}: {nixpkgs.overlays = [self.overlays.unstable];})
({...}: {nixpkgs.overlays = [self.overlays.unstable inputs.audio.overlays.default];})
({...}: {nixpkgs.config.allowUnfree = true;})
./configuration.nix
+3 -4
View File
@@ -52,12 +52,11 @@
};
};
xdg.userDirs.enable = true;
xdg.userDirs.setSessionVariables = true;
xdg.userDirs.createDirectories = true;
xdg.userDirs.extraConfig = {
WORKSPACES = "${config.home.homeDirectory}/Workspaces";
NEXTCLOUD = "${config.home.homeDirectory}/Nextcloud";
NOTES = "${config.home.homeDirectory}/Notes";
XDG_WORKSPACES_DIR = "${config.home.homeDirectory}/Workspaces";
XDG_NEXTCLOUD_DIR = "${config.home.homeDirectory}/Nextcloud";
XDG_NOTES_DIR = "${config.home.homeDirectory}/Notes";
};
# This value determines the Home Manager release that your configuration is
+1 -1
View File
@@ -11,7 +11,7 @@
./configuration.nix
inputs.sops-nix.homeManagerModules.sops
# self.homeModules.layan
self.homeModules.layan
self.homeModules.nextcloud-client
self.homeModules.firefox
self.homeModules.kdeconnect
+2
View File
@@ -111,6 +111,8 @@
trusted-users = [
"@wheel"
];
max-jobs = 2;
cores = 8;
};
gc = {
automatic = true;
-2
View File
@@ -26,8 +26,6 @@
self.nixosModules.openhantek
self.nixosModules.firefox
self.nixosModules.kdeconnect
self.nixosModules.ntsync
self.nixosModules.follow-hive-nixpkgs
];
};
}
+2 -14
View File
@@ -97,6 +97,7 @@
boot.loader.grub.version = 2;
boot.kernelParams = [
"net.ifnames=0" # ensure iface is called eth0
"ip=173.249.42.252::173.249.42.1:255.255.255.0:harbor:eth0:none:8.8.8.8"
];
networking.networkmanager.enable = true;
networking = {
@@ -115,19 +116,6 @@
# Temporary ssh server for disk unlock
boot.initrd = {
availableKernelModules = ["virtio_pci"];
systemd.enable = true;
systemd.users.root.shell = "/usr/bin/systemd-tty-ask-password-agent";
systemd.network = {
enable = true;
networks."10-eth" = {
matchConfig.Name = "eth0";
networkConfig = {
Address = "173.249.42.252/24";
Gateway = "173.249.42.1";
};
routes = [{Gateway = "173.249.42.1";}];
};
};
network = {
enable = true;
ssh = {
@@ -137,7 +125,7 @@
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCyCyYsMSiy7shcehlzJEbCyRiHk+cicFB35Bc2uc4PjjkCjswLh01fRAV2QcplrNkH/5F4GBTbOoZHHc7/AVLyUxgwDC9ffD2i7fevuGpfBFy9D30uz6jDekxXkmRmIlidXLdG1Fh4zwVejGlwdhUu/Zb7PonO/dktx3EFdf1SpnW+y75anN85zoGsld7KQk42wEd0zXtCgx4CKI6Vvt6heWCEiJ9wyw1sLpTJr4H8In236CUj1/r1qY9Gfa8n9NA0J9XCpcwSCEWGRKQNicoQIpnp5txrgzaUq4r6qBKHmImYXmSTVnDZ9dJLRYNu2lDvBtTXP4ztlR6Lpxs873fPg51qgaX9rRVMMo/gGjq8fOFWsDVaJZab9VY3hZYNCKIbWFqo4GKyCQs9Xfzr2AUACm09HWiYMTefwEypOzvUb4z+LF2B/0c5XmghLF/TOzLVgDXzAgWMH4mCnPh9EDLHTtoJaGNURler9VRV8yQyLH6oK9UpHZovCFs7HpFN+WPv2QVFfkK8aHg7tnklFsT78z154bjuspiEI/fFGmTxoQUGufmHlRy/9GQDusgNfe24ZEB2hHBVjKv29XdIfvFAhoPVpA6+O/N3feSlmVISaU+8QraVQEf/TuQjopDUWpJTmqSxKvQSTPwcyWDy6NtcJ85bGAu6jSUGC3ouH4Rb2Q== cardno:000609618602"
];
hostKeys = ["/etc/secrets/initrd/ssh_host_rsa_key"];
shell = "/usr/bin/systemd-tty-ask-password-agent";
shell = "/bin/cryptsetup-askpass";
};
};
};
-4
View File
@@ -74,9 +74,6 @@
clientIdSopsKey = config.sops.secrets.spotifyShortcutsClientId.name;
clientSecretSopsKey = config.sops.secrets.spotifyShortcutsClientSecret.name;
};
hive.ntsync.enable = true;
services.flatpak.enable = true;
# system packages
environment.systemPackages = with pkgs; [
@@ -174,7 +171,6 @@
boot.plymouth.enable = true;
boot.initrd.systemd.enable = true;
boot.supportedFilesystems = ["ntfs"];
boot.kernelPackages = pkgs.linuxPackages_latest;
# Configure console keymap
console.keyMap = "de";
-3
View File
@@ -32,9 +32,6 @@
self.nixosModules.firefox
self.nixosModules.kdeconnect
self.nixosModules.spotify-shortcuts
self.nixosModules.ntsync
self.nixosModules.spicetify
self.nixosModules.follow-hive-nixpkgs
];
};
}
+9 -7
View File
@@ -43,7 +43,7 @@
];
};
environment.systemPackages = with pkgs; [pcmanfm-qt];
environment.systemPackages = with pkgs; [spaceFM];
services.udisks2.enable = true;
programs.hyprlock.enable = true;
security.pam.services.hyprlock = {};
@@ -228,7 +228,6 @@
};
wayland.windowManager.hyprland = {
configType = "hyprlang";
settings = {
exec-once = [
"${pkgs.wpaperd}/bin/wpaperd &"
@@ -357,13 +356,15 @@
layerrule = [
# blur for wlogout
"blur on, match:namespace logout_dialog"
"blur, logout_dialog"
# blur for swaync
"blur on, match:namespace swaync-control-center"
"blur on, match:namespace swaync-notification-window"
"ignore_alpha 0.5, match:namespace swaync-control-center"
"ignore_alpha 0.5, match:namespace swaync-notification-window"
"blur, swaync-control-center"
"blur, swaync-notification-window"
"ignorezero, swaync-control-center"
"ignorezero, swaync-notification-window"
"ignorealpha 0.5, swaync-control-center"
"ignorealpha 0.5, swaync-notification-window"
];
decoration = {
@@ -398,6 +399,7 @@
dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = "yes"; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = "yes"; # you probably want this
};
-1
View File
@@ -45,7 +45,6 @@
# add nord like gtk theme
gtk = {
enable = true;
gtk4.theme = null;
cursorTheme = {
package = pkgs.unstable.layan-cursors;
name = "Layan-cursors";
+1 -2
View File
@@ -4,10 +4,9 @@
programs.firefox.nativeMessagingHosts.packages = [pkgs.passff-host];
};
flake.homeModules.firefox = {config, ...}: {
flake.homeModules.firefox = {
programs.firefox = {
enable = true;
configPath = "${config.home.homeDirectory}/.mozilla/firefox";
# Default profile
profiles.jonas = {
-39
View File
@@ -1,39 +0,0 @@
{
inputs,
self,
...
}: {
flake.overlays.spicetify = final: prev: {
spicetifyPkgs = inputs.spicetify-nix.legacyPackages.${final.stdenv.hostPlatform.system};
};
flake.nixosModules.spicetify-overlay = {
nixpkgs.overlays = [
self.overlays.spicetify
];
};
flake.nixosModules.spicetify = {pkgs, ...}: {
imports = [
self.nixosModules.spicetify-overlay
inputs.spicetify-nix.nixosModules.default
];
programs.spicetify = {
enable = true;
theme = pkgs.spicetifyPkgs.themes.bloom;
enabledCustomApps = with pkgs.spicetifyPkgs.apps; [
historyInSidebar
newReleases
];
enabledExtensions = with pkgs.spicetifyPkgs.extensions; [
betterGenres
catJamSynced
sortPlay
wikify
];
};
};
}
-1
View File
@@ -39,7 +39,6 @@
passwordFile = cfg.databasePasswordFile;
};
settings = {
repository.ENABLE_PUSH_CREATE_USER = true;
server.PROTOCOL = "http+unix";
server.ROOT_URL = "https://${cfg.instanceFQDN}/";
server.DOMAIN = cfg.instanceFQDN;
@@ -36,7 +36,7 @@
servers.bmc3 = lib.optionalAttrs cfg.enable {
enable = true;
autoStart = false;
autoStart = true;
package = pkgs."${loader}Servers".${serverVersion}.override {inherit loaderVersion;};
jvmOpts = modpack.variables.JAVA_ARGS;
symlinks = {
@@ -45,18 +45,6 @@
serverProperties = {
motd = "Woher kommt der Stein?";
white-list = true;
server-port = 25566;
};
};
servers.vanilla = lib.optionalAttrs cfg.enable {
enable = true;
autoStart = false;
package = pkgs.vanillaServers.vanilla-26_1_2;
jvmOpts = "-Xms4G -Xmx4G";
serverProperties = {
motd = "Woher kommt der Stein?";
white-list = true;
server-port = 25565;
};
};
};
-1
View File
@@ -26,7 +26,6 @@
# Zsh
programs.zsh = {
enable = true;
dotDir = "${config.xdg.configHome}/zsh";
enableCompletion = true;
syntaxHighlighting.enable = true;
-31
View File
@@ -1,31 +0,0 @@
{
flake.nixosModules.ntsync = {
config,
lib,
...
}: let
cfg = config.hive.ntsync;
in {
options.hive.ntsync.enable = lib.mkEnableOption "Enable the nt-sync kernel driver.";
options.hive.ntsync.proton = lib.mkOption {
description = "Make proton use ntsync";
default = true;
type = lib.types.bool;
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.14";
message = "ntsync requires at least linux 6.14";
}
];
boot.kernelModules = ["ntsync"];
environment.variables = lib.optionalAttrs cfg.proton {
PROTON_USE_NTSYNC = 1;
};
};
};
}
-1
View File
@@ -1 +0,0 @@
use flake ../../#follow-hive-nixpkgs --show-trace
@@ -1,8 +0,0 @@
{python3Packages}:
with python3Packages;
buildPythonApplication {
name = "follow-hive-nixpkgs";
pyproject = true;
build-system = [setuptools];
src = ./.;
}
@@ -1,15 +0,0 @@
{pkgs ? import <nixpkgs> {}}: let
drv = pkgs.callPackage ./_derivation.nix {};
in
pkgs.mkShell {
packages = [
pkgs.pyright
pkgs.black
];
inputsFrom = [drv];
shellHook = ''
export PYTHONPATH="$PYTHONPATH:$(pwd)"
'';
}
@@ -1,26 +0,0 @@
{self, ...}: {
flake.overlays.follow-hive-nixpkgs = final: prev: {
follow-hive-nixpkgs = final.callPackage ./_derivation.nix {};
};
perSystem = {pkgs, ...}: {
packages.follow-hive-nixpkgs = pkgs.callPackage ./_derivation.nix {};
devShells.follow-hive-nixpkgs = import ./_shell.nix {inherit pkgs;};
};
flake.nixosModules.follow-hive-nixpkgs-overlay = {
nixpkgs.overlays = [
self.overlays.follow-hive-nixpkgs
];
};
flake.nixosModules.follow-hive-nixpkgs = {pkgs, ...}: {
imports = [
self.nixosModules.follow-hive-nixpkgs-overlay
];
environment.systemPackages = [
pkgs.follow-hive-nixpkgs
];
};
}
@@ -1,5 +0,0 @@
from follow_hive_nixpkgs.app import app
def main():
app.main()
@@ -1,30 +0,0 @@
from follow_hive_nixpkgs.config import Config
from follow_hive_nixpkgs.lock import loadNixpkgs, writeNixpkgs
from pathlib import Path
import json
def dry_run(c: Config):
s = loadNixpkgs(c.source_lock, c.source_nixpkgs)
t = loadNixpkgs(c.target_lock, "nixpkgs")
print(
f"Would change {c.target_lock} from:\n{json.dumps(t, indent=2)} to:\n{json.dumps(s, indent=2)}\nWith values from {c.source_lock}"
)
def main():
c = Config.load(
[
Path.home() / ".config/follow-hive-nixpkgs/config.json",
Path("/etc/follow-hive-nixpkgs/config.json"),
]
)
print(c)
if c.dry:
dry_run(c)
else:
s = loadNixpkgs(c.source_lock, c.source_nixpkgs)
writeNixpkgs(s, c.target_lock)
@@ -1,76 +0,0 @@
from dataclasses import dataclass
from pathlib import Path
from typing import Self
import argparse
import sys
import json
@dataclass
class Config:
source_lock: Path = Path.home() / ".hive/flake.lock"
source_nixpkgs: str = "nixpkgs-unstable"
target_lock: Path = Path.cwd() / "flake.lock"
dry: bool = False
@classmethod
def load(cls, paths: list[Path]) -> Self:
c = cls()
args = cls.argparse()
c.dry = args.dry
# Target lock can only be set via args
if args.target_lock:
c.target_lock = Path(args.target_lock)
# We do not need to read config files.
if args.source_lock:
c.source_lock = Path(args.source_lock)
return c
# Check if source_lock is set somewhere
for p in paths:
if not p.exists():
continue
with p.open(mode="r") as f:
cfg = json.load(f)
c.source_lock = Path(cfg["source_lock"])
c.source_nixpkgs = cfg["source_nixpkgs"]
break
return c
@staticmethod
def argparse() -> argparse.Namespace:
args = argparse.ArgumentParser()
args.add_argument(
"--source_lock",
type=Path,
default=None,
required=False,
help="The flake.lock file to read nixpkgs from.",
)
args.add_argument(
"--source_nixpkgs",
type=Path,
default=None,
required=False,
help="The nixpkgs in flake.lock to use.",
)
args.add_argument(
"--target_lock",
type=Path,
default=None,
required=False,
help="The flake.lock file to write nixpkgs to. Use CWD/flake.lock if unset",
)
args.add_argument(
"--dry",
action="store_true",
help="Only show what would be done.",
)
return args.parse_args(sys.argv[1:])
@@ -1,34 +0,0 @@
import json
from pathlib import Path
import sys
def loadNixpkgs(source: Path, nixpkgs: str) -> dict:
if not source.exists():
print(f"{source} does not exist.")
sys.exit(1)
with source.open(mode="r") as f:
src = json.load(f)
if nixpkgs not in src["nodes"]:
print(f"There is no {nixpkgs} entry in {source}")
sys.exit(1)
return src["nodes"][nixpkgs]
def writeNixpkgs(nixpkgs: dict, target: Path):
if not target.exists():
print(f"{target} does not exist.")
sys.exit(1)
with target.open(mode="r+") as f:
tgt = json.load(f)
if "nixpkgs" not in tgt["nodes"]:
print(f"There is no nixpkgs entry in {target}")
sys.exit(1)
tgt["nodes"]["nixpkgs"] = nixpkgs
f.seek(0)
json.dump(tgt, f, indent=2)
f.truncate()
@@ -1,14 +0,0 @@
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="follow_hive_nixpkgs",
version="1.0",
packages=find_packages(),
entry_points={
"console_scripts": [
"follow-hive-nixpkgs=follow_hive_nixpkgs.app:main",
],
},
)
-19
View File
@@ -1,19 +0,0 @@
#!/usr/bin/env bash
# ^ make editor happy
#
# Use https://direnv.net/ to automatically load the dev shell.
#
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
fi
watch_file nix/**
watch_file -- **/*.nix
watch_file uv.lock
# Adding files to git includes them in a flake
# But it is also a bit much reloading.
# watch_file .git/index .git/HEAD
use flake . --show-trace
-95
View File
@@ -1,95 +0,0 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
pyproject-nix.url = "github:pyproject-nix/pyproject.nix";
pyproject-nix.inputs.nixpkgs.follows = "nixpkgs";
uv2nix.url = "github:pyproject-nix/uv2nix";
uv2nix.inputs.pyproject-nix.follows = "pyproject-nix";
uv2nix.inputs.nixpkgs.follows = "nixpkgs";
pyproject-build-systems.url = "github:pyproject-nix/build-system-pkgs";
pyproject-build-systems.inputs.pyproject-nix.follows = "pyproject-nix";
pyproject-build-systems.inputs.uv2nix.follows = "uv2nix";
pyproject-build-systems.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {
flake-parts,
pyproject-nix,
uv2nix,
pyproject-build-systems,
...
}: let
projectName = "YOUR_PROJECT_NAME"; # TODO: Fill in your project name
in
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux"];
perSystem = {
pkgs,
self',
...
}: let
workspace = uv2nix.lib.workspace.loadWorkspace {workspaceRoot = ./.;};
python = pkgs.lib.head (pyproject-nix.lib.util.filterPythonInterpreters {
inherit (workspace) requires-python;
inherit (pkgs) pythonInterpreters;
});
overlay = workspace.mkPyprojectOverlay {
sourcePreference = "wheel";
};
pythonBase = pkgs.callPackage pyproject-nix.build.packages {
inherit python;
};
pythonSet = pythonBase.overrideScope (
pkgs.lib.composeManyExtensions [
pyproject-build-systems.overlays.wheel
overlay
]
);
editableOverlay = workspace.mkEditablePyprojectOverlay {
root = "$REPO_ROOT";
};
editablePythonSet = pythonSet.overrideScope editableOverlay;
devvenv = editablePythonSet.mkVirtualEnv "${projectName}-dev-env" workspace.deps.all;
venv = pythonSet.mkVirtualEnv "${projectName}-env" workspace.deps.default;
in {
packages.default = self'.packages.${projectName};
packages.${projectName} = (pkgs.callPackage pyproject-nix.build.util {}).mkApplication {
inherit venv;
package = pythonSet.${projectName};
};
apps.default = self'.apps.${projectName};
apps.${projectName} = {
type = "app";
program = "${self'.packages.default}/bin/${projectName}";
};
devShells.default = pkgs.mkShell {
packages = [
devvenv
pkgs.uv
];
env = {
UV_NO_SYNC = "1";
UV_PYTHON = editablePythonSet.python.interpreter;
UV_PYTHON_DOWNLOADS = "never";
};
shellHook = ''
unset PYTHONPATH
export REPO_ROOT=$(git rev-parse --show-toplevel)
'';
};
devShells.uv = pkgs.mkShell {
packages = with pkgs; [python3 uv];
};
};
};
}
-17
View File
@@ -1,17 +0,0 @@
_: {
flake.templates.uv-python = {
path = ./_uv-python;
description = "A simple uv2nix python project";
welcomeText = ''
# Setup your uv project first
- Run `nix develop .#uv`
- Run `uv init --app --packages`
- Run `uv lock`
- Edit `projectName` in flake.nix
# Start developing
- Run `direnv allow` or `nix develop`
- Add packages with `uv add --dev black pyright`
'';
};
}