mirror of
https://github.com/sstent/vmimages.git
synced 2026-02-18 05:06:01 +00:00
addin ssh key
This commit is contained in:
@@ -1,7 +1,12 @@
|
|||||||
# This is your system's configuration file.
|
# This is your system's configuration file.
|
||||||
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
|
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
|
||||||
|
{
|
||||||
{ lib, config, pkgs, modulesPath, ... }: {
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
# You can import other NixOS modules here
|
# You can import other NixOS modules here
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
@@ -10,7 +15,6 @@
|
|||||||
# Include static network settings.
|
# Include static network settings.
|
||||||
./networking.nix
|
./networking.nix
|
||||||
"${modulesPath}/virtualisation/hyperv-image.nix"
|
"${modulesPath}/virtualisation/hyperv-image.nix"
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs = {config = {allowUnfree = true;};};
|
nixpkgs = {config = {allowUnfree = true;};};
|
||||||
@@ -41,7 +45,4 @@
|
|||||||
environment.etc."ssh/ssh_host_ed25519_key".source = ./ssh/ssh_host_ed25519_key;
|
environment.etc."ssh/ssh_host_ed25519_key".source = ./ssh/ssh_host_ed25519_key;
|
||||||
environment.etc."ssh/ssh_host_ed25519_key".mode = "0400";
|
environment.etc."ssh/ssh_host_ed25519_key".mode = "0400";
|
||||||
environment.etc."ssh/ssh_host_ed25519_key.pub".source = ./ssh/ssh_host_ed25519_key.pub;
|
environment.etc."ssh/ssh_host_ed25519_key.pub".source = ./ssh/ssh_host_ed25519_key.pub;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
boot.initrd.kernelModules = [];
|
boot.initrd.kernelModules = [];
|
||||||
boot.kernelModules = ["hv_sock"];
|
boot.kernelModules = ["hv_sock"];
|
||||||
|
|
||||||
|
|
||||||
# fileSystems."/" = {
|
# fileSystems."/" = {
|
||||||
# device = "/dev/disk/by-label/nixos";
|
# device = "/dev/disk/by-label/nixos";
|
||||||
# autoResize = true;
|
# autoResize = true;
|
||||||
@@ -35,5 +34,4 @@
|
|||||||
# in ["${automount_opts},credentials=/etc/nixos/smb-secrets"];
|
# in ["${automount_opts},credentials=/etc/nixos/smb-secrets"];
|
||||||
in ["${automount_opts}"];
|
in ["${automount_opts}"];
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
|
{
|
||||||
{ lib, config, pkgs, ... }: {
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
# You can import other NixOS modules here
|
# You can import other NixOS modules here
|
||||||
hyperv = {
|
hyperv = {
|
||||||
baseImageSize = 8096;
|
baseImageSize = 8096;
|
||||||
|
|||||||
61
flake.nix
61
flake.nix
@@ -21,7 +21,10 @@
|
|||||||
# nix-colors.url = "github:misterio77/nix-colors";
|
# nix-colors.url = "github:misterio77/nix-colors";
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware"; # Import nixos hardware quirks settings
|
nixos-hardware.url = "github:NixOS/nixos-hardware"; # Import nixos hardware quirks settings
|
||||||
# nixos-generators = { url = "github:nix-community/nixos-generators"; inputs.nixpkgs.follows = "nixpkgs";}; #import nixos-generators for building images
|
# nixos-generators = { url = "github:nix-community/nixos-generators"; inputs.nixpkgs.follows = "nixpkgs";}; #import nixos-generators for building images
|
||||||
nixos-wsl = {url = "github:nix-community/nixos-wsl"; inputs.nixpkgs.follows = "nixpkgs";};
|
nixos-wsl = {
|
||||||
|
url = "github:nix-community/nixos-wsl";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
sops-nix.url = github:Mic92/sops-nix;
|
sops-nix.url = github:Mic92/sops-nix;
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
# nix.url = "github:NixOS/nix/2.12.0";
|
# nix.url = "github:NixOS/nix/2.12.0";
|
||||||
@@ -45,18 +48,22 @@
|
|||||||
|
|
||||||
# Flake Utility Functions
|
# Flake Utility Functions
|
||||||
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, home-manager,nixpkgs-unstable,... }@inputs:
|
outputs = {
|
||||||
let
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
home-manager,
|
||||||
|
nixpkgs-unstable,
|
||||||
|
...
|
||||||
|
} @ inputs: let
|
||||||
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
||||||
inherit (self) outputs;
|
inherit (self) outputs;
|
||||||
|
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
mkPkgs = pkgs: extraOverlays: import pkgs {
|
mkPkgs = pkgs: extraOverlays:
|
||||||
|
import pkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true; # forgive me Stallman senpai
|
config.allowUnfree = true; # forgive me Stallman senpai
|
||||||
overlays = extraOverlays ++ (lib.attrValues self.overlays);
|
overlays = extraOverlays ++ (lib.attrValues self.overlays);
|
||||||
@@ -64,26 +71,32 @@
|
|||||||
pkgs = mkPkgs nixpkgs [self.overlay];
|
pkgs = mkPkgs nixpkgs [self.overlay];
|
||||||
pkgs' = mkPkgs nixpkgs-unstable [];
|
pkgs' = mkPkgs nixpkgs-unstable [];
|
||||||
|
|
||||||
lib = nixpkgs.lib.extend
|
lib =
|
||||||
(self: super: { my = import ./lib { inherit pkgs inputs outputs; lib = self; }; }// home-manager.lib);
|
nixpkgs.lib.extend
|
||||||
|
(self: super:
|
||||||
|
{
|
||||||
|
my = import ./lib {
|
||||||
|
inherit pkgs inputs outputs;
|
||||||
|
lib = self;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// home-manager.lib);
|
||||||
in {
|
in {
|
||||||
lib = lib.my;
|
lib = lib.my;
|
||||||
packages."${system}" =
|
packages."${system}" =
|
||||||
mapModules ./pkgs (p: pkgs.callPackage p {});
|
mapModules ./pkgs (p: pkgs.callPackage p {});
|
||||||
|
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
|
||||||
|
|
||||||
devShell."${system}" =
|
devShell."${system}" =
|
||||||
import ./shell.nix {inherit pkgs;};
|
import ./shell.nix {inherit pkgs;};
|
||||||
|
|
||||||
overlay =
|
overlay = final: prev: {
|
||||||
final: prev: {
|
|
||||||
#unstable = pkgs';
|
#unstable = pkgs';
|
||||||
my = self.packages."${system}";
|
my = self.packages."${system}";
|
||||||
};
|
};
|
||||||
|
|
||||||
overlays = import ./overlays {inherit inputs;};
|
overlays = import ./overlays {inherit inputs;};
|
||||||
|
|
||||||
|
|
||||||
# Output all modules in ./modules to flake. Modules should be in
|
# Output all modules in ./modules to flake. Modules should be in
|
||||||
# individual subdirectories and contain a default.nix file
|
# individual subdirectories and contain a default.nix file
|
||||||
nixosModules = builtins.listToAttrs (map
|
nixosModules = builtins.listToAttrs (map
|
||||||
@@ -93,7 +106,6 @@
|
|||||||
})
|
})
|
||||||
(builtins.attrNames (builtins.readDir ./modules/nixos)));
|
(builtins.attrNames (builtins.readDir ./modules/nixos)));
|
||||||
|
|
||||||
|
|
||||||
##import our HM modules
|
##import our HM modules
|
||||||
## -- imported in ./home-manger/general
|
## -- imported in ./home-manger/general
|
||||||
|
|
||||||
@@ -104,7 +116,6 @@
|
|||||||
})
|
})
|
||||||
(builtins.attrNames (builtins.readDir ./modules/home-manager)));
|
(builtins.attrNames (builtins.readDir ./modules/home-manager)));
|
||||||
|
|
||||||
|
|
||||||
# nixosConfigurations =
|
# nixosConfigurations =
|
||||||
# mapHosts ./hosts {};
|
# mapHosts ./hosts {};
|
||||||
|
|
||||||
@@ -112,18 +123,23 @@
|
|||||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
go3-wsl = nixpkgs.lib.nixosSystem {
|
go3-wsl = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs outputs lib;hostName = "go3-wsl"; };
|
specialArgs = {
|
||||||
|
inherit inputs outputs lib;
|
||||||
|
hostName = "go3-wsl";
|
||||||
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/go3-wsl
|
./hosts/go3-wsl
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
StuPC-WSL = nixpkgs.lib.nixosSystem {
|
StuPC-WSL = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs outputs lib; hostName = "StuPC";};
|
specialArgs = {
|
||||||
|
inherit inputs outputs lib;
|
||||||
|
hostName = "StuPC";
|
||||||
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/StuPC-WSL
|
./hosts/StuPC-WSL
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Standalone home-manager configuration entrypoint
|
# Standalone home-manager configuration entrypoint
|
||||||
@@ -133,7 +149,10 @@
|
|||||||
"sstent@go3-wsl" = home-manager.lib.homeManagerConfiguration {
|
"sstent@go3-wsl" = home-manager.lib.homeManagerConfiguration {
|
||||||
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||||
pkgs = pkgs;
|
pkgs = pkgs;
|
||||||
extraSpecialArgs = { inherit inputs outputs lib; hostName = "go3-wsl"; };
|
extraSpecialArgs = {
|
||||||
|
inherit inputs outputs lib;
|
||||||
|
hostName = "go3-wsl";
|
||||||
|
};
|
||||||
modules = [
|
modules = [
|
||||||
# > Our main home-manager configuration file <
|
# > Our main home-manager configuration file <
|
||||||
./home-manager/users/sstent
|
./home-manager/users/sstent
|
||||||
@@ -143,7 +162,10 @@
|
|||||||
"sstent@StuPC-WSL" = home-manager.lib.homeManagerConfiguration {
|
"sstent@StuPC-WSL" = home-manager.lib.homeManagerConfiguration {
|
||||||
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||||
pkgs = pkgs;
|
pkgs = pkgs;
|
||||||
extraSpecialArgs = { inherit inputs outputs lib; hostName = "StuPC-WSL";};
|
extraSpecialArgs = {
|
||||||
|
inherit inputs outputs lib;
|
||||||
|
hostName = "StuPC-WSL";
|
||||||
|
};
|
||||||
modules = [
|
modules = [
|
||||||
# > Our main home-manager configuration file <
|
# > Our main home-manager configuration file <
|
||||||
./home-manager/users/sstent
|
./home-manager/users/sstent
|
||||||
@@ -151,6 +173,5 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
{ inputs, lib, pkgs, config, outputs, ... }:
|
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
imports = [
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
outputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports =
|
||||||
|
[
|
||||||
# ./beets.nix
|
# ./beets.nix
|
||||||
# ./keybase.nix
|
# ./keybase.nix
|
||||||
"${inputs.vscode-server}/modules/vscode-server/home.nix"
|
"${inputs.vscode-server}/modules/vscode-server/home.nix"
|
||||||
] ++ (builtins.attrValues outputs.homeManagerModules);
|
]
|
||||||
|
++ (builtins.attrValues outputs.homeManagerModules);
|
||||||
|
|
||||||
|
|
||||||
###dotfiles path variable
|
###dotfiles path variable
|
||||||
options._dotfiles = lib.mkOption {
|
options._dotfiles = lib.mkOption {
|
||||||
@@ -23,7 +28,6 @@
|
|||||||
description = "Path to the Secrets runtime";
|
description = "Path to the Secrets runtime";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
###secretstore path variable
|
###secretstore path variable
|
||||||
options._secretstore = lib.mkOption {
|
options._secretstore = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
@@ -32,14 +36,11 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
overlays = builtins.attrValues outputs.overlays;
|
overlays = builtins.attrValues outputs.overlays;
|
||||||
config = {
|
config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
allowUnfreePredicate = (_: true);
|
allowUnfreePredicate = _: true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -56,7 +57,6 @@ config = {
|
|||||||
services.vscode-server.enableFHS = true;
|
services.vscode-server.enableFHS = true;
|
||||||
services.vscode-server.nodejsPackage = pkgs.nodejs-18_x;
|
services.vscode-server.nodejsPackage = pkgs.nodejs-18_x;
|
||||||
|
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
home-manager.enable = true;
|
home-manager.enable = true;
|
||||||
git.enable = true;
|
git.enable = true;
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
|
|
||||||
{ inputs, outputs, lib, config, pkgs, hostName, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
|
outputs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
hostName,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
../../global.nix
|
../../global.nix
|
||||||
];
|
];
|
||||||
@@ -21,8 +26,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# home.file."/home/sstent/.config/beets/test".source = config.lib.file.mkOutOfStoreSymlink /run/user/1000/secrets/test;
|
# home.file."/home/sstent/.config/beets/test".source = config.lib.file.mkOutOfStoreSymlink /run/user/1000/secrets/test;
|
||||||
|
|
||||||
# Let Home Manager install and manage itself.
|
# Let Home Manager install and manage itself.
|
||||||
@@ -96,7 +99,6 @@
|
|||||||
userName = "sstent";
|
userName = "sstent";
|
||||||
userEmail = "stuart.stent@gmail.com";
|
userEmail = "stuart.stent@gmail.com";
|
||||||
extraConfig = {pull.rebase = true;};
|
extraConfig = {pull.rebase = true;};
|
||||||
|
|
||||||
};
|
};
|
||||||
ssh = {
|
ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -114,9 +116,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#######If Gnome
|
#######If Gnome
|
||||||
# config = lib.mkIf config.mymods.gnome.enable {
|
# config = lib.mkIf config.mymods.gnome.enable {
|
||||||
# programs.bash.enable = true;
|
# programs.bash.enable = true;
|
||||||
@@ -166,7 +166,6 @@
|
|||||||
# ];
|
# ];
|
||||||
# };
|
# };
|
||||||
# "org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; };
|
# "org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; };
|
||||||
|
|
||||||
# };
|
# };
|
||||||
# };
|
# };
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{pkgs}:
|
{pkgs}:
|
||||||
|
pkgs.python3.withPackages (p:
|
||||||
pkgs.python3.withPackages (p: with p; [
|
with p; [
|
||||||
requests # HTTP library
|
requests # HTTP library
|
||||||
setuptools # setup.py
|
setuptools # setup.py
|
||||||
paramiko # ssh library
|
paramiko # ssh library
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
{ lib, pkgs, config, inputs, ... }: {
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
../common.nix
|
../common.nix
|
||||||
../user-sstent.nix
|
../user-sstent.nix
|
||||||
@@ -15,6 +20,4 @@
|
|||||||
syncthing.enable = true;
|
syncthing.enable = true;
|
||||||
wsl.enable = true;
|
wsl.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
# This file (and the global directory) holds config that i use on all hosts
|
# This file (and the global directory) holds config that i use on all hosts
|
||||||
{ lib, inputs, outputs, pkgs, config, ... }:
|
|
||||||
{
|
{
|
||||||
imports = [
|
lib,
|
||||||
|
inputs,
|
||||||
|
outputs,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports =
|
||||||
|
[
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
inputs.sops-nix.nixosModules.sops
|
inputs.sops-nix.nixosModules.sops
|
||||||
]++ (builtins.attrValues outputs.nixosModules);
|
]
|
||||||
|
++ (builtins.attrValues outputs.nixosModules);
|
||||||
|
|
||||||
###dotfiles path variable
|
###dotfiles path variable
|
||||||
options._dotfiles = lib.mkOption {
|
options._dotfiles = lib.mkOption {
|
||||||
@@ -20,7 +28,6 @@
|
|||||||
description = "Path to the Secrets runtime";
|
description = "Path to the Secrets runtime";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
###secretstore path variable
|
###secretstore path variable
|
||||||
options._secretstore = lib.mkOption {
|
options._secretstore = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
@@ -31,13 +38,11 @@
|
|||||||
config = {
|
config = {
|
||||||
system.stateVersion = "23.05";
|
system.stateVersion = "23.05";
|
||||||
|
|
||||||
|
|
||||||
sops = {
|
sops = {
|
||||||
defaultSopsFile = "${config._secretstore}/host-secrets.yaml";
|
defaultSopsFile = "${config._secretstore}/host-secrets.yaml";
|
||||||
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
|
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
extraSpecialArgs = {inherit inputs outputs;};
|
extraSpecialArgs = {inherit inputs outputs;};
|
||||||
@@ -60,7 +65,6 @@ nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
|||||||
# nix.nixPath = [ "nixpkgs=pkgs.outPath" ];
|
# nix.nixPath = [ "nixpkgs=pkgs.outPath" ];
|
||||||
networking.search = ["node.dc1.consul" "service.dc1.consul"];
|
networking.search = ["node.dc1.consul" "service.dc1.consul"];
|
||||||
|
|
||||||
|
|
||||||
#services.envfs.enable = true;
|
#services.envfs.enable = true;
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.git
|
pkgs.git
|
||||||
@@ -76,6 +80,5 @@ nix.gc = {
|
|||||||
dates = "03:15"; # When to run the garbage collector
|
dates = "03:15"; # When to run the garbage collector
|
||||||
options = "-d"; # Arguments to pass to nix-collect-garbage
|
options = "-d"; # Arguments to pass to nix-collect-garbage
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
{ lib, pkgs, config, inputs, ... }: {
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
../common.nix
|
../common.nix
|
||||||
../user-sstent.nix
|
../user-sstent.nix
|
||||||
@@ -16,5 +21,4 @@
|
|||||||
syncthing.enable = true;
|
syncthing.enable = true;
|
||||||
wsl.enable = true;
|
wsl.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{ inputs, lib, config, ... }:
|
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
sops.secrets.sstent_password = {
|
sops.secrets.sstent_password = {
|
||||||
#sopsFile = ./secrets.yaml;
|
#sopsFile = ./secrets.yaml;
|
||||||
neededForUsers = true;
|
neededForUsers = true;
|
||||||
@@ -16,10 +19,8 @@
|
|||||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+D4o3mL4BQsRr0UIhB1hn0brSTIJ9Lr0m2fMMVGF3tIuEihnmwGTeAX78q5/bmoo4gZy7G+CHal54S1lY8LY1KvmIDCpPJ8848HvLbTiTX3qZ7Mjaav+Ox9eHMwX+7zkPwdhfP8TDvmNe12j1GEKBhAm+FhdBQCbEV7cbm1SkX0+WBGoVvI2qbRm1RF0mOuTAmO3Lr2YeAcKJ21YxwNMv1Qrj7oxGYH9rLHLNwZ/0soIdTC9cikl4DHyvCs4HRYcVw36uuCVc/AyIT2GeETRapAQr8nzT89Haa1IThgZ9ztjSsSSOtrUhxatlMIfTIpVjl/gWq7GLfqd/ei/evTal sstent@StuPC"
|
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+D4o3mL4BQsRr0UIhB1hn0brSTIJ9Lr0m2fMMVGF3tIuEihnmwGTeAX78q5/bmoo4gZy7G+CHal54S1lY8LY1KvmIDCpPJ8848HvLbTiTX3qZ7Mjaav+Ox9eHMwX+7zkPwdhfP8TDvmNe12j1GEKBhAm+FhdBQCbEV7cbm1SkX0+WBGoVvI2qbRm1RF0mOuTAmO3Lr2YeAcKJ21YxwNMv1Qrj7oxGYH9rLHLNwZ/0soIdTC9cikl4DHyvCs4HRYcVw36uuCVc/AyIT2GeETRapAQr8nzT89Haa1IThgZ9ztjSsSSOtrUhxatlMIfTIpVjl/gWq7GLfqd/ei/evTal sstent@StuPC"
|
||||||
];
|
];
|
||||||
extraGroups = ["wheel" "video"];
|
extraGroups = ["wheel" "video"];
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# home-manager.users.misterio = import home/${config.networking.hostName}.nix;
|
# home-manager.users.misterio = import home/${config.networking.hostName}.nix;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
{lib, ...}:
|
{lib, ...}:
|
||||||
|
|
||||||
with builtins;
|
with builtins;
|
||||||
with lib;
|
with lib; rec {
|
||||||
rec {
|
|
||||||
# attrsToList
|
# attrsToList
|
||||||
attrsToList = attrs:
|
attrsToList = attrs:
|
||||||
mapAttrsToList (name: value: {inherit name value;}) attrs;
|
mapAttrsToList (name: value: {inherit name value;}) attrs;
|
||||||
|
|||||||
@@ -10,22 +10,26 @@
|
|||||||
# map = callLibs ./map.nix;
|
# map = callLibs ./map.nix;
|
||||||
# ## In configs, they can be used under "lib.our"
|
# ## In configs, they can be used under "lib.our"
|
||||||
# })
|
# })
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
{ inputs, lib, pkgs, ... }:
|
pkgs,
|
||||||
|
...
|
||||||
let
|
}: let
|
||||||
inherit (lib) makeExtensible attrValues foldr;
|
inherit (lib) makeExtensible attrValues foldr;
|
||||||
inherit (modules) mapModules;
|
inherit (modules) mapModules;
|
||||||
|
|
||||||
modules = import ./modules.nix {
|
modules = import ./modules.nix {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
self.attrs = import ./attrs.nix { inherit lib; self = {}; };
|
self.attrs = import ./attrs.nix {
|
||||||
|
inherit lib;
|
||||||
|
self = {};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
mylib = makeExtensible (self:
|
mylib = makeExtensible (self:
|
||||||
with self; mapModules ./.
|
with self;
|
||||||
|
mapModules ./.
|
||||||
(file: import file {inherit self lib pkgs inputs;}));
|
(file: import file {inherit self lib pkgs inputs;}));
|
||||||
in
|
in
|
||||||
mylib.extend
|
mylib.extend
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
{ lib, pkgs, ... }:
|
|
||||||
|
|
||||||
with builtins;
|
|
||||||
with lib;
|
|
||||||
{
|
{
|
||||||
toCSSFile = file:
|
lib,
|
||||||
let fileName = removeSuffix ".scss" (baseNameOf file);
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with builtins;
|
||||||
|
with lib; {
|
||||||
|
toCSSFile = file: let
|
||||||
|
fileName = removeSuffix ".scss" (baseNameOf file);
|
||||||
compiledStyles =
|
compiledStyles =
|
||||||
pkgs.runCommand "compileScssFile"
|
pkgs.runCommand "compileScssFile"
|
||||||
{buildInputs = [pkgs.sass];} ''
|
{buildInputs = [pkgs.sass];} ''
|
||||||
@@ -18,8 +20,8 @@ with lib;
|
|||||||
'';
|
'';
|
||||||
in "${compiledStyles}/${fileName}.css";
|
in "${compiledStyles}/${fileName}.css";
|
||||||
|
|
||||||
toFilteredImage = imageFile: options:
|
toFilteredImage = imageFile: options: let
|
||||||
let result = "result.png";
|
result = "result.png";
|
||||||
filteredImage =
|
filteredImage =
|
||||||
pkgs.runCommand "filterWallpaper"
|
pkgs.runCommand "filterWallpaper"
|
||||||
{buildInputs = [pkgs.imagemagick];} ''
|
{buildInputs = [pkgs.imagemagick];} ''
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
hasSuffix
|
hasSuffix
|
||||||
mapAttrs'
|
mapAttrs'
|
||||||
nameValuePair
|
nameValuePair
|
||||||
|
|
||||||
;
|
;
|
||||||
in rec {
|
in rec {
|
||||||
filter = name: func: attrs: filterAttrs name (mapAttrs' func attrs);
|
filter = name: func: attrs: filterAttrs name (mapAttrs' func attrs);
|
||||||
@@ -26,7 +25,6 @@ in rec {
|
|||||||
sopsFile = dir + "/${name}";
|
sopsFile = dir + "/${name}";
|
||||||
format = "binary";
|
format = "binary";
|
||||||
path = out_dir + "/${name}";
|
path = out_dir + "/${name}";
|
||||||
|
|
||||||
}
|
}
|
||||||
else nameValuePair "" null) (readDir dir);
|
else nameValuePair "" null) (readDir dir);
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,28 @@
|
|||||||
{ self, lib, ... }:
|
{
|
||||||
|
self,
|
||||||
let
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
inherit (builtins) attrValues readDir pathExists concatLists;
|
inherit (builtins) attrValues readDir pathExists concatLists;
|
||||||
inherit (lib) id mapAttrsToList filterAttrs hasPrefix hasSuffix nameValuePair removeSuffix;
|
inherit (lib) id mapAttrsToList filterAttrs hasPrefix hasSuffix nameValuePair removeSuffix;
|
||||||
inherit (self.attrs) mapFilterAttrs;
|
inherit (self.attrs) mapFilterAttrs;
|
||||||
in
|
in rec {
|
||||||
rec {
|
|
||||||
mapModules = dir: fn:
|
mapModules = dir: fn:
|
||||||
mapFilterAttrs
|
mapFilterAttrs
|
||||||
(n: v:
|
(n: v:
|
||||||
v != null &&
|
v
|
||||||
!(hasPrefix "_" n))
|
!= null
|
||||||
(n: v:
|
&& !(hasPrefix "_" n))
|
||||||
let path = "${toString dir}/${n}"; in
|
(n: v: let
|
||||||
|
path = "${toString dir}/${n}";
|
||||||
|
in
|
||||||
if v == "directory" && pathExists "${path}/default.nix"
|
if v == "directory" && pathExists "${path}/default.nix"
|
||||||
then nameValuePair n (fn path)
|
then nameValuePair n (fn path)
|
||||||
else if v == "regular" &&
|
else if
|
||||||
n != "default.nix" &&
|
v
|
||||||
hasSuffix ".nix" n
|
== "regular"
|
||||||
|
&& n != "default.nix"
|
||||||
|
&& hasSuffix ".nix" n
|
||||||
then nameValuePair (removeSuffix ".nix" n) (fn path)
|
then nameValuePair (removeSuffix ".nix" n) (fn path)
|
||||||
else nameValuePair "" null)
|
else nameValuePair "" null)
|
||||||
(readDir dir);
|
(readDir dir);
|
||||||
@@ -28,10 +33,12 @@ rec {
|
|||||||
mapModulesRec = dir: fn:
|
mapModulesRec = dir: fn:
|
||||||
mapFilterAttrs
|
mapFilterAttrs
|
||||||
(n: v:
|
(n: v:
|
||||||
v != null &&
|
v
|
||||||
!(hasPrefix "_" n))
|
!= null
|
||||||
(n: v:
|
&& !(hasPrefix "_" n))
|
||||||
let path = "${toString dir}/${n}"; in
|
(n: v: let
|
||||||
|
path = "${toString dir}/${n}";
|
||||||
|
in
|
||||||
if v == "directory"
|
if v == "directory"
|
||||||
then nameValuePair n (mapModulesRec path fn)
|
then nameValuePair n (mapModulesRec path fn)
|
||||||
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n
|
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n
|
||||||
@@ -39,8 +46,7 @@ rec {
|
|||||||
else nameValuePair "" null)
|
else nameValuePair "" null)
|
||||||
(readDir dir);
|
(readDir dir);
|
||||||
|
|
||||||
mapModulesRec' = dir: fn:
|
mapModulesRec' = dir: fn: let
|
||||||
let
|
|
||||||
dirs =
|
dirs =
|
||||||
mapAttrsToList
|
mapAttrsToList
|
||||||
(k: _: "${dir}/${k}")
|
(k: _: "${dir}/${k}")
|
||||||
@@ -49,5 +55,6 @@ rec {
|
|||||||
(readDir dir));
|
(readDir dir));
|
||||||
files = attrValues (mapModules dir id);
|
files = attrValues (mapModules dir id);
|
||||||
paths = files ++ concatLists (map (d: mapModulesRec' d id) dirs);
|
paths = files ++ concatLists (map (d: mapModulesRec' d id) dirs);
|
||||||
in map fn paths;
|
in
|
||||||
|
map fn paths;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
{ inputs, lib, pkgs, ... }:
|
{
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with lib.my;
|
with lib.my; let
|
||||||
let sys = "x86_64-linux";
|
sys = "x86_64-linux";
|
||||||
in {
|
in {
|
||||||
mkHost = path: attrs @ {system ? sys, ...}:
|
mkHost = path: attrs @ {system ? sys, ...}:
|
||||||
nixosSystem {
|
nixosSystem {
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
{ lib, ... }:
|
{lib, ...}: let
|
||||||
|
|
||||||
let
|
|
||||||
inherit (lib) mkOption types;
|
inherit (lib) mkOption types;
|
||||||
in
|
in rec {
|
||||||
rec {
|
|
||||||
mkOpt = type: default:
|
mkOpt = type: default:
|
||||||
mkOption {inherit type default;};
|
mkOption {inherit type default;};
|
||||||
|
|
||||||
mkOpt' = type: default: description:
|
mkOpt' = type: default: description:
|
||||||
mkOption {inherit type default description;};
|
mkOption {inherit type default description;};
|
||||||
|
|
||||||
mkBoolOpt = default: mkOption {
|
mkBoolOpt = default:
|
||||||
|
mkOption {
|
||||||
inherit default;
|
inherit default;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
example = true;
|
example = true;
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{
|
||||||
with lib;
|
config,
|
||||||
|
pkgs,
|
||||||
let cfg = config.custom.beets;
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.custom.beets;
|
||||||
in {
|
in {
|
||||||
options.custom.beets = {
|
options.custom.beets = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
@@ -16,7 +20,6 @@ in {
|
|||||||
pkgs.ffmpeg # for replaygain
|
pkgs.ffmpeg # for replaygain
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
sops = {
|
sops = {
|
||||||
secrets.discogs_json = {
|
secrets.discogs_json = {
|
||||||
path = "${config.xdg.configHome}/beets/discogs_token.json";
|
path = "${config.xdg.configHome}/beets/discogs_token.json";
|
||||||
@@ -93,8 +96,7 @@ in {
|
|||||||
isMultidisc = "1 if disctotal > 1 else 0";
|
isMultidisc = "1 if disctotal > 1 else 0";
|
||||||
myBitDepth = "('' if bitdepth != 24 else '[24bit - '+ media + ']')";
|
myBitDepth = "('' if bitdepth != 24 else '[24bit - '+ media + ']')";
|
||||||
myDisc = "('' if disctotal <= 1 else str(disc) + ' - ')";
|
myDisc = "('' if disctotal <= 1 else str(disc) + ' - ')";
|
||||||
mySongartist =
|
mySongartist = "artist + ' - ' if artist != albumartist and artist != '' else ''";
|
||||||
"artist + ' - ' if artist != albumartist and artist != '' else ''";
|
|
||||||
};
|
};
|
||||||
library = "~/musiclibrary.db";
|
library = "~/musiclibrary.db";
|
||||||
match = {
|
match = {
|
||||||
@@ -123,8 +125,7 @@ in {
|
|||||||
};
|
};
|
||||||
missing = {
|
missing = {
|
||||||
format_album = "$albumartist: ($year) $album $albumtype $atype";
|
format_album = "$albumartist: ($year) $album $albumtype $atype";
|
||||||
format_item =
|
format_item = "$albumartist - $album [$albumtype]$atype: $track/$tracktotal $title";
|
||||||
"$albumartist - $album [$albumtype]$atype: $track/$tracktotal $title";
|
|
||||||
};
|
};
|
||||||
musicbrainz = {
|
musicbrainz = {
|
||||||
pass = "7ANCLPczDNFn6Sf65vdZ";
|
pass = "7ANCLPczDNFn6Sf65vdZ";
|
||||||
@@ -132,12 +133,9 @@ in {
|
|||||||
};
|
};
|
||||||
original_date = true;
|
original_date = true;
|
||||||
paths = {
|
paths = {
|
||||||
"albumtype:soundtrack" =
|
"albumtype:soundtrack" = "Soundtracks/$albumartist - $album%aunique{} ($year)/$myDisc$track - $artist - $title";
|
||||||
"Soundtracks/$albumartist - $album%aunique{} ($year)/$myDisc$track - $artist - $title";
|
comp = "Compilations/$albumartist/($year) $album%aunique{}/$myDisc$track - $artist - $title";
|
||||||
comp =
|
default = "%if{$artist_grouping,$artist_grouping/}$first_artist/$year - $album $atype%aunique{media}[%upper{$format}$bitdepth]%if{$media,[$media]}/%if{$isMultidisc,$disc - }$track - $mySongartist$title";
|
||||||
"Compilations/$albumartist/($year) $album%aunique{}/$myDisc$track - $artist - $title";
|
|
||||||
default =
|
|
||||||
"%if{$artist_grouping,$artist_grouping/}$first_artist/$year - $album $atype%aunique{media}[%upper{$format}$bitdepth]%if{$media,[$media]}/%if{$isMultidisc,$disc - }$track - $mySongartist$title";
|
|
||||||
};
|
};
|
||||||
per_disc_numbering = true;
|
per_disc_numbering = true;
|
||||||
plugins = [
|
plugins = [
|
||||||
@@ -160,19 +158,15 @@ in {
|
|||||||
rewrite = {
|
rewrite = {
|
||||||
"artist Björk & Tríó Guðmundar Ingólfssonar" = "Björk";
|
"artist Björk & Tríó Guðmundar Ingólfssonar" = "Björk";
|
||||||
"artist Brant Bjork and The Low Desert Punk Band" = "Brant Bjork";
|
"artist Brant Bjork and The Low Desert Punk Band" = "Brant Bjork";
|
||||||
"artist King Gizzard & The Lizard Wizard with Mild High Club" =
|
"artist King Gizzard & The Lizard Wizard with Mild High Club" = "King Gizzard & The Lizard Wizard";
|
||||||
"King Gizzard & The Lizard Wizard";
|
|
||||||
"artist Kyuss _ Queens of the Stone Age" = "Kyuss";
|
"artist Kyuss _ Queens of the Stone Age" = "Kyuss";
|
||||||
"artist Professor Elemental & Tom Caruana" = "Professor Elemental";
|
"artist Professor Elemental & Tom Caruana" = "Professor Elemental";
|
||||||
"artist Resin Dogs Feat Spikey Tee" = "Resin Dogs";
|
"artist Resin Dogs Feat Spikey Tee" = "Resin Dogs";
|
||||||
"artist Sepultura _ Exodus" = "Sepultura";
|
"artist Sepultura _ Exodus" = "Sepultura";
|
||||||
"artist The Knife in collaboration with Mount Sims and Planningtorock" =
|
"artist The Knife in collaboration with Mount Sims and Planningtorock" = "The Knife";
|
||||||
"The Knife";
|
|
||||||
"artist Unida _ Dozer" = "Unida";
|
"artist Unida _ Dozer" = "Unida";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
{ config, pkgs, inputs, lib, util, hostName, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
util,
|
||||||
|
hostName,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with lib.my;
|
with lib.my; let
|
||||||
let
|
|
||||||
cfg = config.custom.keybase;
|
cfg = config.custom.keybase;
|
||||||
username = config.home.username;
|
username = config.home.username;
|
||||||
secretstore = config._secretstore;
|
secretstore = config._secretstore;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
options.custom.keybase = {
|
options.custom.keybase = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
@@ -15,7 +21,6 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
services.keybase.enable = true;
|
services.keybase.enable = true;
|
||||||
services.kbfs.enable = true;
|
services.kbfs.enable = true;
|
||||||
@@ -27,4 +32,3 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
{ lib, pkgs, config, ... }:
|
{
|
||||||
with lib;
|
lib,
|
||||||
|
pkgs,
|
||||||
let cfg = config.custom.ssh-proxy;
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.custom.ssh-proxy;
|
||||||
in {
|
in {
|
||||||
options.custom.ssh-proxy = {
|
options.custom.ssh-proxy = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
@@ -14,19 +18,19 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
npiperelay
|
npiperelay
|
||||||
socat
|
socat
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
systemd.user = {
|
systemd.user = {
|
||||||
|
|
||||||
startServices = true;
|
startServices = true;
|
||||||
|
|
||||||
services.ssh-proxy = {
|
services.ssh-proxy = {
|
||||||
Unit = { Description = "WSL Proxy"; After = "sops-nix.service";};
|
Unit = {
|
||||||
|
Description = "WSL Proxy";
|
||||||
|
After = "sops-nix.service";
|
||||||
|
};
|
||||||
Install = {WantedBy = ["default.target"];};
|
Install = {WantedBy = ["default.target"];};
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${pkgs.writeShellScript "start-proxy" ''
|
ExecStart = "${pkgs.writeShellScript "start-proxy" ''
|
||||||
@@ -35,10 +39,7 @@ ${pkgs.coreutils}/bin/rm -f /home/sstent/.ssh/wsl-ssh-agent.sock
|
|||||||
${pkgs.util-linux}/bin/setsid ${pkgs.socat}/bin/socat UNIX-LISTEN:/home/sstent/.ssh/wsl-ssh-agent.sock,fork EXEC:"${pkgs.npiperelay}/bin/npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork
|
${pkgs.util-linux}/bin/setsid ${pkgs.socat}/bin/socat UNIX-LISTEN:/home/sstent/.ssh/wsl-ssh-agent.sock,fork EXEC:"${pkgs.npiperelay}/bin/npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork
|
||||||
''}";
|
''}";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,16 @@
|
|||||||
{ lib, inputs, outputs, config, ... }:
|
{
|
||||||
with lib;
|
lib,
|
||||||
|
inputs,
|
||||||
let cfg = config.custom.mnt_public;
|
outputs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.custom.mnt_public;
|
||||||
in {
|
in {
|
||||||
options.custom.mnt_public.enable = mkEnableOption "Enable mnt/Public";
|
options.custom.mnt_public.enable = mkEnableOption "Enable mnt/Public";
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
|
||||||
fileSystems."/mnt/Public" = {
|
fileSystems."/mnt/Public" = {
|
||||||
device = "//192.168.1.109/Public";
|
device = "//192.168.1.109/Public";
|
||||||
fsType = "cifs";
|
fsType = "cifs";
|
||||||
@@ -16,4 +19,3 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
{ lib, pkgs, config, ... }:
|
{
|
||||||
with lib;
|
lib,
|
||||||
|
pkgs,
|
||||||
let cfg = config.custom.sshd;
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.custom.sshd;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
#define option to enable this
|
#define option to enable this
|
||||||
options.custom.sshd.enable = mkEnableOption "Enable SSH";
|
options.custom.sshd.enable = mkEnableOption "Enable SSH";
|
||||||
|
|
||||||
@@ -15,6 +18,5 @@ services.openssh = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [22];
|
networking.firewall.allowedTCPPorts = [22];
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,16 @@
|
|||||||
{ lib, inputs, outputs, config, ... }:
|
{
|
||||||
with lib;
|
lib,
|
||||||
|
inputs,
|
||||||
let cfg = config.custom.syncthing;
|
outputs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.custom.syncthing;
|
||||||
in {
|
in {
|
||||||
options.custom.syncthing.enable = mkEnableOption "Enable mnt/Public";
|
options.custom.syncthing.enable = mkEnableOption "Enable mnt/Public";
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
services.syncthing = {
|
services.syncthing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dataDir = "/home/sstent";
|
dataDir = "/home/sstent";
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
{ lib, pkgs, config, ... }:
|
{
|
||||||
with lib;
|
lib,
|
||||||
|
pkgs,
|
||||||
let
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
secretstore = config._secretstore;
|
secretstore = config._secretstore;
|
||||||
host = config.networking.hostName;
|
host = config.networking.hostName;
|
||||||
|
|
||||||
cfg = config.custom.mullvad;
|
cfg = config.custom.mullvad;
|
||||||
|
|
||||||
secret = if builtins.pathExists "${secretstore}/hosts/${host}/mullvad/device.json" then
|
secret =
|
||||||
./secrets.nix
|
if builtins.pathExists "${secretstore}/hosts/${host}/mullvad/device.json"
|
||||||
else
|
then ./secrets.nix
|
||||||
{ };
|
else {};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
#define option to enable this
|
#define option to enable this
|
||||||
options.custom.mullvad.enable = mkEnableOption "Enable SSH";
|
options.custom.mullvad.enable = mkEnableOption "Enable SSH";
|
||||||
|
|
||||||
@@ -33,9 +34,5 @@ in {
|
|||||||
${pkgs.mullvad}/bin/mullvad relay set location ca mtr
|
${pkgs.mullvad}/bin/mullvad relay set location ca mtr
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,18 @@
|
|||||||
{ lib, pkgs, config, ... }:
|
{
|
||||||
with lib;
|
lib,
|
||||||
|
pkgs,
|
||||||
let
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
secretstore = config._secretstore;
|
secretstore = config._secretstore;
|
||||||
host = config.networking.hostName;
|
host = config.networking.hostName;
|
||||||
secretpath = "${secretstore}/hosts/${host}/mullvad/device.json";
|
secretpath = "${secretstore}/hosts/${host}/mullvad/device.json";
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
|
|
||||||
sops.secrets.device_json = {
|
sops.secrets.device_json = {
|
||||||
sopsFile = "${secretstore}/hosts/${host}/mullvad/device.json";
|
sopsFile = "${secretstore}/hosts/${host}/mullvad/device.json";
|
||||||
device_json.format = "binary";
|
device_json.format = "binary";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc."mullvad-vpn/device.conf".source = config.sops.secrets.device_json.path;
|
environment.etc."mullvad-vpn/device.conf".source = config.sops.secrets.device_json.path;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,17 @@
|
|||||||
{ lib, inputs, outputs, config, pkgs, ... }:
|
{
|
||||||
with lib;
|
lib,
|
||||||
|
inputs,
|
||||||
let cfg = config.custom.wsl;
|
outputs,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.custom.wsl;
|
||||||
in {
|
in {
|
||||||
options.custom.wsl.enable = mkEnableOption "Enable WSL2 settings";
|
options.custom.wsl.enable = mkEnableOption "Enable WSL2 settings";
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
# Enable native Docker support
|
# Enable native Docker support
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
|
|
||||||
@@ -48,9 +53,5 @@ in {
|
|||||||
};
|
};
|
||||||
wantedBy = ["sysinit.target"];
|
wantedBy = ["sysinit.target"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file
|
# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file
|
||||||
# This is useful to avoid using channels when using legacy nix commands
|
# This is useful to avoid using channels when using legacy nix commands
|
||||||
let lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
|
let
|
||||||
|
lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
|
||||||
in
|
in
|
||||||
import (fetchTarball {
|
import (fetchTarball {
|
||||||
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
|
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
# This file defines overlays
|
# This file defines overlays
|
||||||
{ inputs, ... }:
|
{inputs, ...}: {
|
||||||
{
|
|
||||||
# This one brings our custom packages from the 'pkgs' directory
|
# This one brings our custom packages from the 'pkgs' directory
|
||||||
additions = final: _prev: import ../pkgs {pkgs = final;};
|
additions = final: _prev: import ../pkgs {pkgs = final;};
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# Custom packages, that can be defined similarly to ones from nixpkgs
|
# Custom packages, that can be defined similarly to ones from nixpkgs
|
||||||
# You can build them using 'nix build .#example' or (legacy) 'nix-build -A example'
|
# You can build them using 'nix build .#example' or (legacy) 'nix-build -A example'
|
||||||
|
|
||||||
{pkgs ? (import ../nixpkgs.nix) {}}: {
|
{pkgs ? (import ../nixpkgs.nix) {}}: {
|
||||||
# example = pkgs.callPackage ./example { };
|
# example = pkgs.callPackage ./example { };
|
||||||
npiperelay = pkgs.callPackage ./npiperelay {};
|
npiperelay = pkgs.callPackage ./npiperelay {};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
{ lib, stdenv, fetchurl ,unzip }:
|
{
|
||||||
|
lib,
|
||||||
let
|
stdenv,
|
||||||
|
fetchurl,
|
||||||
|
unzip,
|
||||||
|
}: let
|
||||||
version = "1.6.3";
|
version = "1.6.3";
|
||||||
srcs = {
|
srcs = {
|
||||||
x86_64-linux = fetchurl {
|
x86_64-linux = fetchurl {
|
||||||
url =
|
url = "https://github.com/jstarks/npiperelay/releases/download/v0.1.0/npiperelay_windows_amd64.zip";
|
||||||
"https://github.com/jstarks/npiperelay/releases/download/v0.1.0/npiperelay_windows_amd64.zip";
|
|
||||||
sha256 = "sha256-a572H/0XwDUHqaPVTYFdzrPa5mmsZ/w79CJdHnZM5fY=";
|
sha256 = "sha256-a572H/0XwDUHqaPVTYFdzrPa5mmsZ/w79CJdHnZM5fY=";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -15,8 +17,8 @@ let
|
|||||||
# sha256 = "sha256-zuy4e9bzcRqDeXP6mfzZLCDK/3we25LH6xktnO6HXps=";
|
# sha256 = "sha256-zuy4e9bzcRqDeXP6mfzZLCDK/3we25LH6xktnO6HXps=";
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
|
in
|
||||||
in stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "npiperelay";
|
pname = "npiperelay";
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
@@ -39,12 +41,10 @@ in stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description =
|
description = "Helper to interface with Windows ssh-agent.exe service from Windows Subsystem for Linux (WSL)";
|
||||||
"Helper to interface with Windows ssh-agent.exe service from Windows Subsystem for Linux (WSL)";
|
|
||||||
# 2019-08-19: The homepage links to old software that doesn't even work --
|
# 2019-08-19: The homepage links to old software that doesn't even work --
|
||||||
# it fails to detect ConBee2.
|
# it fails to detect ConBee2.
|
||||||
homepage =
|
homepage = "https://github.com/rupor-github/wsl-ssh-agent";
|
||||||
"https://github.com/rupor-github/wsl-ssh-agent";
|
|
||||||
license = licenses.free;
|
license = licenses.free;
|
||||||
platforms = ["x86_64-linux"];
|
platforms = ["x86_64-linux"];
|
||||||
maintainers = with maintainers; [sstent];
|
maintainers = with maintainers; [sstent];
|
||||||
|
|||||||
21
shell.nix
21
shell.nix
@@ -1,23 +1,23 @@
|
|||||||
{pkgs ? import <nixpkgs> {}}:
|
{pkgs ? import <nixpkgs> {}}:
|
||||||
|
with pkgs; let
|
||||||
with pkgs;
|
nixBin = writeShellScriptBin "nix" ''
|
||||||
let nixBin =
|
|
||||||
writeShellScriptBin "nix" ''
|
|
||||||
${nixFlakes}/bin/nix --option experimental-features "nix-command flakes" "$@"
|
${nixFlakes}/bin/nix --option experimental-features "nix-command flakes" "$@"
|
||||||
'';
|
'';
|
||||||
in mkShell {
|
in
|
||||||
|
mkShell {
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
nix home-manager git ssh-to-age sops age
|
nix
|
||||||
|
home-manager
|
||||||
|
git
|
||||||
|
ssh-to-age
|
||||||
|
sops
|
||||||
|
age
|
||||||
];
|
];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export FLAKE="$(pwd)"
|
export FLAKE="$(pwd)"
|
||||||
export PATH="$FLAKE/bin:${nixBin}/bin:$PATH"
|
export PATH="$FLAKE/bin:${nixBin}/bin:$PATH"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# { pkgs ? (import ./nixpkgs.nix) { } }: {
|
# { pkgs ? (import ./nixpkgs.nix) { } }: {
|
||||||
# default = pkgs.mkShell {
|
# default = pkgs.mkShell {
|
||||||
# # Enable experimental features without having to specify the argument
|
# # Enable experimental features without having to specify the argument
|
||||||
@@ -25,3 +25,4 @@ in mkShell {
|
|||||||
# nativeBuildInputs = with pkgs; [ nix home-manager git ssh-to-age sops age ];
|
# nativeBuildInputs = with pkgs; [ nix home-manager git ssh-to-age sops age ];
|
||||||
# };
|
# };
|
||||||
# }
|
# }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user