aaaaaaa
This commit is contained in:
18
README.md
18
README.md
@@ -1,13 +1,31 @@
|
|||||||
more just notes for now
|
more just notes for now
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
nixos-rebuild switch --flake .#triple-dezert --target-host trip.shelvacu.com --use-remote-sudo
|
nixos-rebuild switch --flake .#triple-dezert --target-host trip.shelvacu.com --use-remote-sudo
|
||||||
```
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
build flake on remote machine, including eval:
|
build flake on remote machine, including eval:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git add . && ssh trip nix flake check $(nix flake archive --to ssh://trip --json | jq .path -r)
|
git add . && ssh trip nix flake check $(nix flake archive --to ssh://trip --json | jq .path -r)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
search for string in closure
|
||||||
|
|
||||||
|
```sh
|
||||||
|
rg search_str $(nix path-info --recursive ./result)
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```sh
|
||||||
|
rg search_str $(nix path-info --recursive .#qb.trip)
|
||||||
|
```
|
||||||
|
@@ -24,19 +24,16 @@ in
|
|||||||
};
|
};
|
||||||
vacu.versionInfo = mkOption { readOnly = true; };
|
vacu.versionInfo = mkOption { readOnly = true; };
|
||||||
vacu.hostName = mkOption {
|
vacu.hostName = mkOption {
|
||||||
type = types.str; # default = "BADDEFAULTHOSTNAME";
|
type = types.str;
|
||||||
};
|
};
|
||||||
vacu.shortHostName = mkOption {
|
vacu.shortHostName = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = config.vacu.hostName;
|
default = config.vacu.hostName;
|
||||||
};
|
};
|
||||||
|
vacu.nixvimPkg = mkOption { readOnly = true; };
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
# assertions = [{
|
vacu.packages = (with pkgs; [
|
||||||
# assertion = config.vacu.hostName != "BADDEFAULTHOSTNAME";
|
|
||||||
# message = "must set vacu.hostName";
|
|
||||||
# }];
|
|
||||||
vacu.packages = with pkgs; [
|
|
||||||
home-manager
|
home-manager
|
||||||
nixos-rebuild
|
nixos-rebuild
|
||||||
which
|
which
|
||||||
@@ -71,7 +68,7 @@ in
|
|||||||
ssh-to-age
|
ssh-to-age
|
||||||
sops
|
sops
|
||||||
inetutils
|
inetutils
|
||||||
#neovim
|
neovim
|
||||||
diffutils
|
diffutils
|
||||||
findutils
|
findutils
|
||||||
utillinux
|
utillinux
|
||||||
@@ -96,15 +93,16 @@ in
|
|||||||
killall
|
killall
|
||||||
git
|
git
|
||||||
curl
|
curl
|
||||||
|
]) ++ [
|
||||||
inputs.nix-search-cli.packages.${pkgs.system}.default
|
inputs.nix-search-cli.packages.${pkgs.system}.default
|
||||||
inputs.nix-inspect.packages.${pkgs.system}.default
|
inputs.nix-inspect.packages.${pkgs.system}.default
|
||||||
(inputs.nixvim.legacyPackages.${pkgs.system}.makeNixvimWithModule {
|
];
|
||||||
|
vacu.nixvimPkg = inputs.nixvim.legacyPackages.${pkgs.system}.makeNixvimWithModule {
|
||||||
extraSpecialArgs = { inherit inputs; };
|
extraSpecialArgs = { inherit inputs; };
|
||||||
module = {
|
module = {
|
||||||
imports = [ ./nixvim.nix ];
|
imports = [ ../nixvim ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
})
|
|
||||||
];
|
|
||||||
vacu.versionId = toString (self.shortRev or self.dirtyShortRev);
|
vacu.versionId = toString (self.shortRev or self.dirtyShortRev);
|
||||||
vacu.versionInfo = {
|
vacu.versionInfo = {
|
||||||
id = self.rev or self.dirtyRev;
|
id = self.rev or self.dirtyRev;
|
||||||
|
@@ -28,7 +28,9 @@ in
|
|||||||
};
|
};
|
||||||
vacu.nix.substituterUrls = mkOption { readOnly = true; };
|
vacu.nix.substituterUrls = mkOption { readOnly = true; };
|
||||||
vacu.nix.trustedKeys = mkOption { readOnly = true; };
|
vacu.nix.trustedKeys = mkOption { readOnly = true; };
|
||||||
|
vacu.nix.plainOptions = mkOption {};
|
||||||
};
|
};
|
||||||
config.vacu.nix.substituterUrls = map (c: c.url) enabledCaches;
|
config.vacu.nix.substituterUrls = map (c: c.url) enabledCaches;
|
||||||
config.vacu.nix.trustedKeys = builtins.concatMap (c: c.keys) enabledCaches;
|
config.vacu.nix.trustedKeys = builtins.concatMap (c: c.keys) enabledCaches;
|
||||||
|
config.vacu.nix.plainOptions.allowUnfree = true;
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
# These are the things that might in a simpler time go in ~/.bashrc as aliases. But they're not aliases, cuz aliases are bad
|
# These are the things that might in a simpler time go in ~/.bashrc as aliases. But they're not aliases, cuz aliases are bad
|
||||||
{ pkgs, vaculib, ... }:
|
{ pkgs, vaculib, config, ... }:
|
||||||
let
|
let
|
||||||
inherit (pkgs) writeScriptBin;
|
inherit (pkgs) writeScriptBin;
|
||||||
inherit (vaculib) writeShellFunction;
|
inherit (vaculib) writeShellFunction;
|
||||||
@@ -34,12 +34,14 @@ in
|
|||||||
done
|
done
|
||||||
rm "$@"
|
rm "$@"
|
||||||
'')
|
'')
|
||||||
|
|
||||||
(writeShellFunction "nd" ''
|
(writeShellFunction "nd" ''
|
||||||
declare -a args
|
declare -a args
|
||||||
args=("$@")
|
args=("$@")
|
||||||
mkdir "''${args[@]}" && cd "''${args[-1]}"
|
mkdir "''${args[@]}" && cd "''${args[-1]}"
|
||||||
'')
|
'')
|
||||||
(writeShellFunction "td" ''pushd $(mktemp "$@")'')
|
(writeShellFunction "td" ''pushd $(mktemp "$@")'')
|
||||||
|
(writeShellFunction "nvim-plain" ''${pkgs.neovim}/bin/nvim "$@"'')
|
||||||
|
(writeShellFunction "nvim-nixvim" ''${config.vacu.nixvimPkg}/bin/nvim "$@"'')
|
||||||
|
(writeShellFunction "nvim" ''nvim-plain "$@"'')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -54,6 +54,8 @@
|
|||||||
#update: it didn't work, I dunno why. Leaving this here anyways
|
#update: it didn't work, I dunno why. Leaving this here anyways
|
||||||
services.fwupd.daemonSettings.EspLocation = lib.mkForce "/boot0";
|
services.fwupd.daemonSettings.EspLocation = lib.mkForce "/boot0";
|
||||||
|
|
||||||
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
services.displayManager.sddm.enable = true;
|
services.displayManager.sddm.enable = true;
|
||||||
services.desktopManager.plasma6.enable = true;
|
services.desktopManager.plasma6.enable = true;
|
||||||
|
@@ -1,4 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
{
|
|
||||||
a = 1;
|
|
||||||
}
|
|
28
nixvim/default.nix
Normal file
28
nixvim/default.nix
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{ ... }: let
|
||||||
|
in
|
||||||
|
{
|
||||||
|
plugins.comment.enable = true;
|
||||||
|
plugins.surround.enable = true;
|
||||||
|
plugins.lsp = {
|
||||||
|
enable = true;
|
||||||
|
onAttach = builtins.readFile ./nixd-init.lua;
|
||||||
|
servers = {
|
||||||
|
bashls.enable = true;
|
||||||
|
jsonls.enable = true;
|
||||||
|
# nil-ls.enable = true;
|
||||||
|
nixd = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
pyright.enable = true;
|
||||||
|
tsserver.enable = true;
|
||||||
|
lua-ls.enable = true;
|
||||||
|
rust-analyzer = {
|
||||||
|
enable = true;
|
||||||
|
installCargo = false;
|
||||||
|
installRustc = false;
|
||||||
|
};
|
||||||
|
html.enable = true;
|
||||||
|
yamlls.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
22
nixvim/nixd-init.lua
Normal file
22
nixvim/nixd-init.lua
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
--@param client vim.lsp.Client
|
||||||
|
local function init_per_dir_nixd(client)
|
||||||
|
if client.workspace_folders == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local path = client.workspace_folders[1].name
|
||||||
|
local command = client.config.cmd[1]
|
||||||
|
local name = string.gsub(command, "(.*/)(.*)", "%2")
|
||||||
|
local is_nixd = name == "nixd"
|
||||||
|
local is_nix_stuff = (path == '/home/shelvacu/dev/nix-stuff' or path == '/home/shelvacu/nix-stuff' or path == '/data/data/com.termux.nix/files/home/nix-stuff')
|
||||||
|
if is_nixd and is_nix_stuff then
|
||||||
|
local get_flake = "(builtins.getFlake \"" .. path .. "\")"
|
||||||
|
client.config.settings["nixd"].options = {
|
||||||
|
nixos = { expr = get_flake .. ".nixosConfigurations.fw.options", },
|
||||||
|
["home-manager"] = { expr = get_flake .. ".homeConfigurations.\"nix-on-droid\".options", },
|
||||||
|
["nix-on-droid"] = { expr = get_flake .. ".nixOnDroidConfigurations.default.options", },
|
||||||
|
}
|
||||||
|
client.notify("workspace/didChangeConfiguration", { settings = client.config.settings, })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
init_per_dir_nixd(client)
|
@@ -1,8 +1,6 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
@@ -20,7 +18,7 @@
|
|||||||
./static-stuff.nix
|
./static-stuff.nix
|
||||||
#./vms.nix
|
#./vms.nix
|
||||||
./networking.nix
|
./networking.nix
|
||||||
./devver-host.nix
|
#./devver-host.nix
|
||||||
./emily.nix
|
./emily.nix
|
||||||
./jellyfin.nix
|
./jellyfin.nix
|
||||||
];
|
];
|
||||||
@@ -44,12 +42,13 @@
|
|||||||
|
|
||||||
services.xserver.enable = false;
|
services.xserver.enable = false;
|
||||||
|
|
||||||
vacu.packages = with pkgs; [
|
vacu.packages = (with pkgs; [
|
||||||
zfs
|
zfs
|
||||||
smartmontools
|
smartmontools
|
||||||
openvpn
|
openvpn
|
||||||
nvme-cli
|
nvme-cli
|
||||||
tshark
|
tshark
|
||||||
|
]) ++ [
|
||||||
config.services.postgresql.package
|
config.services.postgresql.package
|
||||||
(pkgs.writeScriptBin "into-nix-cache" ''
|
(pkgs.writeScriptBin "into-nix-cache" ''
|
||||||
if [[ $UID -ne 0 ]]; then exec sudo $0 "$@";fi
|
if [[ $UID -ne 0 ]]; then exec sudo $0 "$@";fi
|
||||||
@@ -71,14 +70,6 @@
|
|||||||
ports = [ 6922 ];
|
ports = [ 6922 ];
|
||||||
};
|
};
|
||||||
|
|
||||||
system.copySystemConfiguration = false;
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
|
||||||
# settings for stateful data, like file locations and database versions
|
|
||||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
||||||
# this value at the release version of the first install of this system.
|
|
||||||
# Before changing this value read the documentation for this option
|
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
||||||
system.stateVersion = "22.05"; # Did you read the comment?
|
system.stateVersion = "22.05"; # Did you read the comment?
|
||||||
|
|
||||||
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
||||||
|
Reference in New Issue
Block a user