switched to headscale flake

This commit is contained in:
Nickiel12 2023-12-03 14:07:13 -08:00
parent ca7ccf8dc8
commit b8ada4438f
4 changed files with 17 additions and 20 deletions

View file

@ -162,17 +162,17 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1701336075, "lastModified": 1683878976,
"narHash": "sha256-1AN5KGL42BwBNkJMjS2ZDcd/CT/AtH1BkT+azHMI5NY=", "narHash": "sha256-nqmTqe3F3Oh8rnJH0clwACD/0RpqmfOMXNubr3C8rEc=",
"owner": "kradalby", "owner": "juanfont",
"repo": "headscale", "repo": "headscale",
"rev": "bbb4c357268998fd02780b7f8f2013f76e3ab80a", "rev": "b01f1f1867136d9b2d7b1392776eb363b482c525",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "kradalby", "owner": "juanfont",
"repo": "headscale", "repo": "headscale",
"rev": "bbb4c357268998fd02780b7f8f2013f76e3ab80a", "rev": "b01f1f1867136d9b2d7b1392776eb363b482c525",
"type": "github" "type": "github"
} }
}, },

View file

@ -5,11 +5,14 @@
utils.url = "github:numtide/flake-utils"; utils.url = "github:numtide/flake-utils";
nixvim.url = "github:nix-community/nixvim"; nixvim.url = "github:nix-community/nixvim";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/release-23.05"; nixpkgs-stable = {
url = "github:NixOS/nixpkgs/release-23.05";
};
kmonad.url = "github:kmonad/kmonad?dir=nix"; kmonad.url = "github:kmonad/kmonad?dir=nix";
headscale = { headscale = {
url = "github:kradalby/headscale/bbb4c357268998fd02780b7f8f2013f76e3ab80a"; # url = "github:kradalby/headscale/bbb4c357268998fd02780b7f8f2013f76e3ab80a";
url = "github:juanfont/headscale/b01f1f1867136d9b2d7b1392776eb363b482c525";
# url = "github:juanfont/headscale"; # Real repo # url = "github:juanfont/headscale"; # Real repo
inputs."flake-utils".follows = "utils"; inputs."flake-utils".follows = "utils";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -40,14 +43,6 @@
user = "nixolas"; user = "nixolas";
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [
headscale.overlay
];
config.allowUnfree = true;
};
pkgs-stable = import nixpkgs-stable { pkgs-stable = import nixpkgs-stable {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
@ -63,7 +58,7 @@
Alaska = lib.nixosSystem { Alaska = lib.nixosSystem {
inherit system; inherit system;
specialArgs = { specialArgs = {
inherit user pkgs pkgs-stable; inherit user headscale pkgs-stable;
}; };
modules = [ modules = [
@ -95,7 +90,7 @@
NicksNixLaptop = lib.nixosSystem { NicksNixLaptop = lib.nixosSystem {
inherit system; inherit system;
specialArgs = { specialArgs = {
inherit user pkgs; inherit user;
}; };
modules = [ modules = [

View file

@ -1,5 +1,5 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, headscale, ... }:
{ {
@ -33,6 +33,7 @@
}; };
}; };
# headscale dns is handled by dnsmasq
networking.hosts = { networking.hosts = {
"100.64.0.1" = ["files.nickiel.net" "git.nickiel.net" "nickiel.net" "jellyfin.nickiel.net" ]; "100.64.0.1" = ["files.nickiel.net" "git.nickiel.net" "nickiel.net" "jellyfin.nickiel.net" ];
}; };

View file

@ -1,4 +1,4 @@
{ config, ... }: { config, headscale, ... }:
let let
tailscale_dns_entries = import ./dns.nix; tailscale_dns_entries = import ./dns.nix;
@ -13,6 +13,7 @@ in {
# https://carjorvaz.com/posts/setting-up-headscale-on-nixos/ # https://carjorvaz.com/posts/setting-up-headscale-on-nixos/
services.headscale = { services.headscale = {
package = headscale.packages."x86_64-linux".headscale;
enable = true; enable = true;
address = "0.0.0.0"; address = "0.0.0.0";
port = 8082; port = 8082;