Compare commits

...

9 commits

15 changed files with 140 additions and 19 deletions

View file

@ -136,11 +136,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1690476848, "lastModified": 1691225770,
"narHash": "sha256-PSmzyuEbMxEn2uwwLYUN2l1psoJXb7jm/kfHD12Sq0k=", "narHash": "sha256-O5slH8nW8msTAqVAS5rkvdHSkjmrO+JauuSDzZCmv2M=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "8d243f7da13d6ee32f722a3f1afeced150b6d4da", "rev": "0a014a729cdd54d9919ff36b714d047909d7a4c8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -233,11 +233,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1690272529, "lastModified": 1691186842,
"narHash": "sha256-MakzcKXEdv/I4qJUtq/k/eG+rVmyOZLnYNC2w1mB59Y=", "narHash": "sha256-wxBVCvZUwq+XS4N4t9NqsHV4E64cPVqQ2fdDISpjcw0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ef99fa5c5ed624460217c31ac4271cfb5cb2502c", "rev": "18036c0be90f4e308ae3ebcab0e14aae0336fe42",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -46,7 +46,13 @@
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { inherit user; }; extraSpecialArgs = { inherit user; };
users.${user} = import ./users/${user}.nix; users.${user} = {
imports = [
(import ./users/${user}.nix)
# Add nixvim to the homemanager
inputs.nixvim.homeManagerModules.nixvim
];
};
}; };
} }
]; ];
@ -69,7 +75,13 @@
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { inherit user; }; extraSpecialArgs = { inherit user; };
users.${user} = import ./users/${user}.nix; users.${user} = {
imports = [
(import ./users/${user}.nix)
# Add nixvim to the homemanager
inputs.nixvim.homeManagerModules.nixvim
];
};
}; };
} }
]; ];

View file

@ -5,10 +5,12 @@
{ {
imports = [ imports = [
(import ./hardware-configuration.nix) (import ./hardware-configuration.nix)
(import ./modules/forgejo.nix)
(import ./modules/nginx.nix) (import ./modules/nginx.nix)
(import ./modules/nextcloud.nix) (import ./modules/nextcloud.nix)
(import ./modules/msmtp.nix) (import ./modules/msmtp.nix)
(import ./modules/forgejo.nix) (import ./modules/headscale.nix)
(import ./modules/tailscale.nix)
]; ];
environment.systemPackages = [ environment.systemPackages = [

View file

@ -0,0 +1,18 @@
{ config, ... }:
let
baseDomain = "nickiel.net";
domain = "headscale.${baseDomain}";
in {
# https://carjorvaz.com/posts/setting-up-headscale-on-nixos/
services.headscale = {
enable = true;
address = "0.0.0.0";
port = 8082;
settings = {
server_url = "https://${domain}";
dns_config.base_domain = baseDomain;
};
};
environment.systemPackages = [ config.services.headscale.package ];
}

View file

@ -22,6 +22,13 @@
virtualHosts = { virtualHosts = {
"default" = {
default = true;
serverName = null;
# https://stackoverflow.com/a/42802777
locations."/".return = "444";
};
"jellyfin.nickiel.net" = { "jellyfin.nickiel.net" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
@ -43,6 +50,15 @@
locations."/".proxyPass = "http://127.0.0.1:3001"; locations."/".proxyPass = "http://127.0.0.1:3001";
}; };
"headscale.nickiel.net" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${ toString config.services.headscale.port }";
proxyWebsockets = true;
};
};
}; };
}; };
} }

View file

@ -0,0 +1,22 @@
{ config, ... }:
{
# to add a new headscale "user", run this command
# sudo headscale users create elnuhub
# then run this command where headscale_url is the http path
# to the server
# tailscale up --login-server <headscale_url>
# then replace USERNAME with the computer's hostname which you created
# an "user" account in the first comment
# use this for android instructions
# https://github.com/juanfont/headscale/blob/main/docs/android-client.md
services.tailscale.enable = true;
# Defined here to indicate the settings are related
networking.firewall = {
checkReversePath = "loose";
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
};
}

View file

@ -7,8 +7,16 @@
]; ];
networking.hosts = { networking.hosts = {
"10.0.0.183" = [ "files.nickiel.net" "git.nickiel.net" "nickiel.net" "jellyfin.nickiel.net" ]; "10.0.0.183" = [ "headscale.nickiel.net" ];
"100.64.0.1" = ["files.nickiel.net" "git.nickiel.net" "nickiel.net" "jellyfin.nickiel.net" ];
}; };
services.tailscale.enable = true;
networking.firewall = {
checkReversePath = "loose";
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
};
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.enable = true; hardware.opengl.enable = true;
@ -26,11 +34,22 @@
efiSysMountPoint = "/boot"; efiSysMountPoint = "/boot";
}; };
grub = { grub = {
enable = true;
devices = [ "nodev" ]; devices = [ "nodev" ];
efiSupport = true; efiSupport = true;
enable = true; useOSProber = false;
useOSProber = true;
extraEntries = '' extraEntries = ''
menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-6877-BD74' {
insmod part_gpt
insmod fat
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 6877-BD74
else
search --no-floppy --fs-uuid --set=root 6877-BD74
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
''; '';
}; };
}; };

View file

@ -1,4 +1,4 @@
{ ... }: { config, ... }:
{ {
imports = [ imports = [
@ -8,11 +8,18 @@
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
networking.hosts = { networking.hosts = {
"10.0.0.183" = [ "files.nickiel.net" "git.nickiel.net" "nickiel.net" "jellyfin.nickiel.net" ]; "10.0.0.183" = [ "headscale.nickiel.net" ];
"100.64.0.1" = ["files.nickiel.net" "git.nickiel.net" "nickiel.net" "jellyfin.nickiel.net" ];
};
services.tailscale.enable = true;
networking.firewall = {
checkReversePath = "loose";
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
}; };
time.hardwareClockInLocalTime = true; time.hardwareClockInLocalTime = true;
boot.loader = { boot.loader = {
efi = { efi = {
canTouchEfiVariables = true; canTouchEfiVariables = true;

View file

@ -2,6 +2,12 @@
let let
in in
{ {
home.packages = with pkgs; [
# Required clipboard provider
xclip
];
programs.nixvim = { programs.nixvim = {
enable = true; enable = true;
viAlias = true; viAlias = true;
@ -9,6 +15,7 @@ in
globals = { globals = {
mapleader = " "; mapleader = " ";
clipboard = "unnamedplus";
}; };
options = { options = {
@ -22,13 +29,26 @@ in
}; };
# https://github.com/pupbrained/nix-config/blob/29af4835f21940af51b86313c451fb572a29874a/pkgs/nixvim.nix#L8 # https://github.com/pupbrained/nix-config/blob/29af4835f21940af51b86313c451fb572a29874a/pkgs/nixvim.nix#L8
# maps. maps.normal = {
"<leader>ot" = "<cmd>vs | te<cr>";
"<leader>o." = "<cmd>Telescope file_browser<cr>";
"<leader>op" = "<cmd>NvimTreeToggle<cr>";
};
plugins = { plugins = {
telescope = { telescope = {
enable = true; enable = true;
}; };
nvim-tree = {
enable = true;
openOnSetup = true;
};
presence-nvim = {
enable = true;
};
treesitter = { treesitter = {
enable = true; enable = true;
folding = true; folding = true;
@ -88,6 +108,7 @@ in
extraConfigLua = builtins.readFile ./../rsrcs/nvim.lua; extraConfigLua = builtins.readFile ./../rsrcs/nvim.lua;
extraPlugins = with pkgs.vimPlugins; extraPlugins = with pkgs.vimPlugins;
[ [
telescope-file-browser-nvim
monokai-pro-nvim monokai-pro-nvim
nvim-lspconfig nvim-lspconfig
hop-nvim hop-nvim

View file

@ -125,7 +125,7 @@ hop.setup {
keys = 'etovxqpdygfblzhckisuran', keys = 'etovxqpdygfblzhckisuran',
} }
local directions = require('hop.hint').HintDirection local directions = require('hop.hint').HintDirection
vim.keymap.set('', '<C-f>', function() vim.keymap.set('', '<leader>ff', function()
hop.hint_patterns({ multi_windows = true, current_line_only = false }) hop.hint_patterns({ multi_windows = true, current_line_only = false })
end, {remap=true}) end, {remap=true})
@ -178,3 +178,6 @@ require("monokai-pro").setup({
}) })
vim.cmd.colorscheme "monokai-pro-spectrum" vim.cmd.colorscheme "monokai-pro-spectrum"
require("telescope").load_extension "file_browser"

View file

@ -20,11 +20,11 @@ in
imports = [ imports = [
../modules/discord.nix ../modules/discord.nix
../modules/emacs.nix #../modules/emacs.nix
../modules/fusuma.nix ../modules/fusuma.nix
../modules/git.nix ../modules/git.nix
../modules/rofi.nix
../modules/neovim.nix ../modules/neovim.nix
../modules/rofi.nix
../modules/wezterm.nix ../modules/wezterm.nix
../modules/xdg.nix ../modules/xdg.nix
../modules/zsh.nix ../modules/zsh.nix
@ -81,6 +81,7 @@ in
flameshot # screenshot utility flameshot # screenshot utility
fontpreview # utility to preview fonts fontpreview # utility to preview fonts
gitui # command line git tui gitui # command line git tui
helvum # audio sink gui control
pandoc # utility for converting between document types pandoc # utility for converting between document types
qmk # QMK utility for compiling qmk firmware qmk # QMK utility for compiling qmk firmware
nextcloud-client # Nextcloud private syncing nextcloud-client # Nextcloud private syncing