This commit is contained in:
asonix 2023-02-10 19:25:49 -06:00
commit 7ed6b1abb5
5 changed files with 402 additions and 0 deletions

124
flake.lock Normal file
View file

@ -0,0 +1,124 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1674440933,
"narHash": "sha256-CASRcD/rK3fn5vUCti3jzry7zi0GsqRsBohNq9wPgLs=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "65c47ced082e3353113614f77b1bc18822dc731f",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-22.11",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1675918889,
"narHash": "sha256-hy7re4F9AEQqwZxubct7jBRos6md26bmxnCjxf5utJA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "49efda9011e8cdcd6c1aad30384cb1dc230c82fe",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1675942811,
"narHash": "sha256-/v4Z9mJmADTpXrdIlAjFa1e+gkpIIROR670UVDQFwIw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "724bfc0892363087709bd3a5a1666296759154b1",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"obs-scene-switcher": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1674699178,
"narHash": "sha256-L6YRJ3dHAUTGp0kvuBsIth1JAW+TLRiDlwF54cYQxMg=",
"ref": "refs/heads/main",
"rev": "9b299e7975e3099e86f8e7ddf9e59ac60abe53cf",
"revCount": 7,
"type": "git",
"url": "https://git.asonix.dog/asonix/nix-obs-scene-switcher"
},
"original": {
"type": "git",
"url": "https://git.asonix.dog/asonix/nix-obs-scene-switcher"
}
},
"obs-streamfx": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1674698913,
"narHash": "sha256-tooIielbexsKXo8kFqFbl0Zo2vCA3wTu8jL05xO2rs8=",
"ref": "refs/heads/main",
"rev": "d1df2d9ad343b198e7f3be026030d2a5ad81ff65",
"revCount": 5,
"type": "git",
"url": "https://git.asonix.dog/asonix/nix-obs-streamfx"
},
"original": {
"type": "git",
"url": "https://git.asonix.dog/asonix/nix-obs-streamfx"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"obs-scene-switcher": "obs-scene-switcher",
"obs-streamfx": "obs-streamfx"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

40
flake.nix Normal file
View file

@ -0,0 +1,40 @@
{
description = "Home Manager configuration of Jane Doe";
inputs = {
# Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-22.11";
inputs.nixpkgs.follows = "nixpkgs";
};
obs-scene-switcher = {
url = "git+https://git.asonix.dog/asonix/nix-obs-scene-switcher";
inputs.nixpkgs.follows = "nixpkgs";
};
obs-streamfx = {
url = "git+https://git.asonix.dog/asonix/nix-obs-streamfx";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, ... }@attrs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
homeConfigurations.asonix = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = [ ./home.nix ];
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
extraSpecialArgs = attrs;
};
};
}

77
home.nix Normal file
View file

@ -0,0 +1,77 @@
{ config, pkgs, nixpkgs-unstable, obs-scene-switcher, obs-streamfx, ... }:
let
unstable = import nixpkgs-unstable {
system = "x86_64-linux";
};
in
{
imports = [ ./zsh.nix ./ssh.nix ];
home.username = "asonix";
home.homeDirectory = "/home/asonix";
nixpkgs.overlays = [
(self: super: {
obs-studio-plugins = super.obs-studio-plugins // {
obs-scene-switcher = obs-scene-switcher.obs-scene-switcher;
obs-streamfx = obs-streamfx.obs-streamfx;
};
neovim = unstable.neovim;
nextcloud-client = unstable.nextcloud-client;
})
];
home.packages = with pkgs; [
bat
bottom
dig
exa
htop
neofetch
starship
topgrade
carla
cura
freecad
gnome.dconf-editor
# helvum
nextcloud-client
patchage
pavucontrol
tdesktop
vlc
neovim
];
home.stateVersion = "22.05";
programs.home-manager.enable = true;
programs.git = {
enable = true;
userName = "asonix";
userEmail = "asonix@asonix.dog";
};
programs.bat.enable = true;
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
input-overlay
obs-backgroundremoval
obs-gstreamer
obs-move-transition
obs-multi-rtmp
obs-nvfbc
obs-pipewire-audio-capture
obs-scene-switcher
obs-source-record
obs-streamfx
obs-vkcapture
wlrobs
];
};
}

72
ssh.nix Normal file
View file

@ -0,0 +1,72 @@
{ config, pkgs, ... }:
let
server = ({ hostname, user ? "asonix", port ? 22, proxyJump ? true }: {
hostname = hostname;
user = user;
identitiesOnly = true;
identityFile = "/home/asonix/.ssh/kube-rsa";
port = port;
proxyJump = if proxyJump then "router" else null;
});
in
{
programs.ssh = {
enable = true;
matchBlocks = {
"github.com" = {
hostname = "github.com";
user = "git";
identitiesOnly = true;
identityFile = "/home/asonix/.ssh/github";
port = 22;
};
"gitlab.com" = {
hostname = "gitlab.com";
user = "git";
identitiesOnly = true;
identityFile = "/home/asonix/.ssh/gitlab";
port = 22;
};
"git.asonix.dog" = {
hostname = "git.asonix.dog";
user = "git";
identitiesOnly = true;
identityFile = "/home/asonix/.ssh/gitea-key";
port = 22;
};
"router" = server {
hostname = "ssh.asonix.dog";
port = 3128;
proxyJump = false;
};
"mc1" = server { hostname = "192.168.20.100"; };
"build2" = server { hostname = "192.168.20.99"; };
"bluestar" = server { hostname = "192.168.20.36"; };
"nextcloud" = server { hostname = "192.168.20.21"; };
"nextcloud2" = server { hostname = "192.168.20.28"; };
"lionheart" = server { hostname = "192.168.5.6"; };
"redtail" = server { hostname = "192.168.20.23"; };
"redtail2" = server { hostname = "192.168.20.24"; };
"whitestorm" = server { hostname = "192.168.20.11"; };
"whitestorm2" = server { hostname = "192.168.20.26"; };
"gluster2" = server { hostname = "192.168.20.19"; user = "kube"; };
"gluster3" = server { hostname = "192.168.20.25"; };
"gluster4" = server { hostname = "192.168.20.33"; };
"k3s1" = server { hostname = "192.168.20.120"; };
"k3s2" = server { hostname = "192.168.20.121"; };
"k3s3" = server { hostname = "192.168.20.122"; };
"k3s4" = server { hostname = "192.168.20.123"; };
"k3s5" = server { hostname = "192.168.20.124"; };
"k3s6" = server { hostname = "192.168.20.125"; };
"k3s-rock1" = server { hostname = "192.168.20.20"; };
"k3s-rock2" = server { hostname = "192.168.20.111"; };
"k3s-rock3" = server { hostname = "192.168.20.112"; };
"k3s-rock4" = server { hostname = "192.168.20.113"; };
"k3s-rock5" = server { hostname = "192.168.20.114"; };
"k3s-quartza1" = server { hostname = "192.168.20.160"; };
"k3s-rockpro1" = server { hostname = "192.168.20.180"; };
};
};
}

89
zsh.nix Normal file
View file

@ -0,0 +1,89 @@
{ config, pkgs, ... }:
{
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
enableAutosuggestions = true;
shellAliases = {
ls = "exa";
l = "exa -l";
la = "exa -la";
cat = "bat";
};
initExtra = ''
bindkey -v
if [ "$IN_NIX_SHELL" = "impure" ]; then
alias v=lvim
alias vi=lvim
alias vim=lvim
alias b='cargo build'
alias r='cargo run'
alias c='cargo check'
alias t='cargo test'
else
alias v=nvim
alias vi=nvim
alias vim=nvim
alias dev="nix-shell $HOME/Development/default.nix"
fi
eval "$(starship init zsh)"
'';
plugins = with pkgs; [
{
name = "zsh-syntax-highlighting";
src = fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.7.1";
sha256 = "gOG0NLlaJfotJfs+SUhGgLTNOnGLjoqnUp54V9aFJg8=";
};
file = "zsh-syntax-highlighting.zsh";
}
{
name = "zsh-completions";
src = fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-completions";
rev = "0.34.0";
sha256 = "qSobM4PRXjfsvoXY6ENqJGI9NEAaFFzlij6MPeTfT0o=";
};
file = "zsh-completions.plugin.zsh";
}
{
name = "base16-shell";
src = fetchFromGitHub {
owner = "chriskempson";
repo = "base16-shell";
rev = "ae84047d378700bfdbabf0886c1fb5bb1033620f";
sha256 = "0qy+huAbPypEMkMumDtzcJdQQx5MVgsvgYu4Em/FGpQ=";
};
file = "base16-shell.plugin.zsh";
}
{
name = "zsh-z";
src = fetchFromGitHub {
owner = "agkozak";
repo = "zsh-z";
rev = "aaafebcd97424c570ee247e2aeb3da30444299cd";
sha256 = "9Wr4uZLk2CvINJilg4o72x0NEAl043lP30D3YnHk+ZA=";
};
file = "zsh-z.plugin.zsh";
}
{
name = "zsh-nix-shell";
src = fetchFromGitHub {
owner = "chisui";
repo = "zsh-nix-shell";
rev = "v0.5.0";
sha256 = "0za4aiwwrlawnia4f29msk822rj9bgcygw6a8a6iikiwzjjz0g91";
};
file = "nix-shell.plugin.zsh";
}
];
};
}