This commit is contained in:
2023-02-22 10:38:24 -05:00
parent 199060ee56
commit 33b693a2a3
12 changed files with 88 additions and 124 deletions

View File

@@ -27,12 +27,12 @@
#nixos-wsl
nixos-wsl.url = github:nix-community/NixOS-WSL;
nixos-wsl.inputs.nixpkgs.follows = "nixpkgs";
inputs.sops-nix.url = github:Mic92/sops-nix;
npiperelay.url = "path:./pkgs/npiperelay";
};
outputs = inputs@{ self, nixpkgs, home-manager, nixos-generators, nixos-wsl,deploy-rs
, agenix, npiperelay, ... }:
outputs = inputs@{ self, nixpkgs, nixos-generators, deploy-rs
, ... }:
let
system = "x86_64-linux";
myData = import ./data.nix;
@@ -46,7 +46,7 @@
./hosts/HyperV/configuration.nix
./modules
# Add agenix for secret management.
agenix.nixosModules.age
#inputs.agenix.nixosModules.age
{
environment.systemPackages = [agenix.defaultPackage.${system}];
}
@@ -64,9 +64,11 @@
modules = [
./hosts/wsl2
./modules
nixos-wsl.nixosModules.wsl
inputs.nixos-wsl.nixosModules.wsl
inputs.agenix.nixosModules.age
inputs.home-manager.nixosModules.home-manager
inputs.sops-nix.nixosModules.sops
# Add agenix for secret management.
# agenix.nixosModules.age
# {

View File

@@ -2,7 +2,7 @@
imports = [
# New module organization
./gnome
./wslsshagent
./home-manager
./base.nix
./ssh.nix
./user.nix

View File

@@ -1,62 +0,0 @@
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "sstent";
home.homeDirectory = "/home/sstent";
#targets.genericLinux.enable = true;
# changes in each release.
# home.stateVersion = "22.05";
home.stateVersion = "23.05";
programs.bash.enable = true;
programs.firefox.enable = true;
programs.gnome-terminal.enable = true;
programs.gnome-terminal.profile = {
"f2afd3c7-cb35-4d08-b6c2-523b444be64d" = {
visibleName = "Stu";
showScrollbar = true;
default = true;
font = "DejaVu Sans Mono 12";
colors = {
backgroundColor = "rgb(23,20,33)";
foregroundColor = "rgb(208,207,204)";
palette = [
"#272224"
"#FF473D"
"#3DCCB2"
"#FF9600"
"#3B7ECB"
"#F74C6D"
"#00B5FC"
"#3E3E3E"
"#52494C"
"#FF6961"
"#85E6D4"
"#FFB347"
"#779ECB"
"#F7A8B8"
"#55CDFC"
"#EEEEEC"
];
};
};
};
xdg.configFile."gnome-initial-setup-done".text = "yes";
xdg.configFile."gtk-3.0/bookmarks".text = ''
file:///mnt/Public Public
'';
dconf.settings = {
# ...
"org/gnome/shell" = {
favorite-apps = [
"firefox.desktop"
"org.gnome.Terminal.desktop"
"org.gnome.Nautilus.desktop"
];
};
"org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; };
};
}

View File

@@ -2,6 +2,10 @@
{ config, pkgs, lib, ... }:
{
options.mymods.beets.enable = lib.mkEnableOption "Enable SSH";
config = lib.mkIf config.mymods.beets.enable {
programs.beets = {
enable = true;
settings = {
@@ -143,6 +147,7 @@
};
};
}

View File

@@ -0,0 +1,8 @@
{...}: {
imports = [
# New module organization
./beets.nix
./nicotine.nix
./sstent.nix
];
}

View File

@@ -1,8 +1,13 @@
{ config, pkgs, ... }:
{
options.mymods.nicotine.enable = lib.mkEnableOption "Enable Nicotine";
config = lib.mkIf config.mymods.nicotine.enable {
home.packages = with pkgs; [
nicotine-plus
];
xdg.configFile."nicotine/config.old".source = ./configs/nicotine;
}
};
}

View File

@@ -18,16 +18,6 @@
home-manager.users."sstent" = {
home.username = "sstent";
home.homeDirectory = "/home/sstent";
#targets.genericLinux.enable = true;
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
# Let Home Manager install and manage itself.
@@ -60,7 +50,7 @@
services.keybase.enable = true;
services.kbfs.enable = true;
home.file.".mrconfig".source = ./mrconfig;
home.file.".mrconfig".source = configs/mrconfig;
# xdg.configFile."beets/config.yaml".source = ./beets_config.yaml;
programs = {
dircolors.enable = true;
@@ -110,9 +100,64 @@ programs = {
};
};
imports = [
./beets.nix
]; };
};
#######If Gnome
config = lib.mkIf config.mymods.gnome.enable {
programs.bash.enable = true;
programs.firefox.enable = true;
programs.gnome-terminal.enable = true;
programs.gnome-terminal.profile = {
"f2afd3c7-cb35-4d08-b6c2-523b444be64d" = {
visibleName = "Stu";
showScrollbar = true;
default = true;
font = "DejaVu Sans Mono 12";
colors = {
backgroundColor = "rgb(23,20,33)";
foregroundColor = "rgb(208,207,204)";
palette = [
"#272224"
"#FF473D"
"#3DCCB2"
"#FF9600"
"#3B7ECB"
"#F74C6D"
"#00B5FC"
"#3E3E3E"
"#52494C"
"#FF6961"
"#85E6D4"
"#FFB347"
"#779ECB"
"#F7A8B8"
"#55CDFC"
"#EEEEEC"
];
};
};
};
xdg.configFile."gnome-initial-setup-done".text = "yes";
xdg.configFile."gtk-3.0/bookmarks".text = ''
file:///mnt/Public Public
'';
dconf.settings = {
# ...
"org/gnome/shell" = {
favorite-apps = [
"firefox.desktop"
"org.gnome.Terminal.desktop"
"org.gnome.Nautilus.desktop"
];
};
"org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; };
};
};
};
}

View File

@@ -1,12 +0,0 @@
{ lib, config, pkgs, ... }: {
#define option to enable this
options.mymods.wslsshagent.enable = lib.mkEnableOption "Enable WSL Agent forwarder";
config = lib.mkIf config.mymods.wslsshagent.enable {
###
};
}

View File

@@ -1,27 +0,0 @@
#!/usr/bin/env bash
# Usage: wsl-ssh-agent-forward [ -k | -r ]
# Options:
# -k Kill the current process (if exists) and do not restart it.
# -r Kill the current process (if exists) and restart it.
# Default operation is to start a process only if it does not exist.
export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock
sshpid=$(ss -ap | grep "$SSH_AUTH_SOCK")
if [ "$1" = "-k" ] || [ "$1" = "-r" ]; then
sshpid=${sshpid//*pid=/}
sshpid=${sshpid%%,*}
if [ -n "${sshpid}" ]; then
kill "${sshpid}"
else
echo "'socat' not found or PID not found"
fi
if [ "$1" = "-k" ]; then
exit
fi
unset sshpid
fi
if [ -z "${sshpid}" ]; then
rm -f $SSH_AUTH_SOCK
( setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"$HOME/bin/npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork & ) >/de>fi

View File

@@ -24,5 +24,5 @@ fi
if [ -z "${sshpid}" ]; then
rm -f $SSH_AUTH_SOCK
( setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork & ) >/de>fi
( setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork & ) >/dev/null
fi