mirror of
https://github.com/sstent/vmimages.git
synced 2025-12-06 06:01:51 +00:00
sync
This commit is contained in:
27
flake.nix
27
flake.nix
@@ -35,33 +35,14 @@
|
|||||||
outputs = { self, nixpkgs, home-manager, ... }@inputs:
|
outputs = { self, nixpkgs, home-manager, ... }@inputs:
|
||||||
let
|
let
|
||||||
inherit (self) outputs;
|
inherit (self) outputs;
|
||||||
forAllSystems = nixpkgs.lib.genAttrs [
|
forEachSystem = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ];
|
||||||
"aarch64-linux"
|
forEachPkgs = f: forEachSystem (sys: f nixpkgs.legacyPackages.${sys});
|
||||||
"i686-linux"
|
|
||||||
"x86_64-linux"
|
|
||||||
];
|
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
# Your custom packages
|
packages = forEachPkgs (pkgs: import ./pkgs { inherit pkgs; });
|
||||||
# Acessible through 'nix build', 'nix shell', etc
|
devShells = forEachPkgs (pkgs: import ./shell.nix { inherit pkgs; });
|
||||||
packages = forAllSystems (system:
|
|
||||||
let pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
in import ./pkgs { inherit pkgs; }
|
|
||||||
);
|
|
||||||
# Devshell for bootstrapping
|
|
||||||
# Acessible through 'nix develop' or 'nix-shell' (legacy)
|
|
||||||
devShells = forAllSystems (system:
|
|
||||||
let pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
in import ./shell.nix { inherit pkgs; }
|
|
||||||
);
|
|
||||||
|
|
||||||
# Your custom packages and modifications, exported as overlays
|
|
||||||
overlays = import ./overlays { inherit inputs; };
|
overlays = import ./overlays { inherit inputs; };
|
||||||
# Reusable nixos modules you might want to export
|
|
||||||
# These are usually stuff you would upstream into nixpkgs
|
|
||||||
nixosModules = import ./modules/nixos;
|
nixosModules = import ./modules/nixos;
|
||||||
# Reusable home-manager modules you might want to export
|
|
||||||
# These are usually stuff you would upstream into home-manager
|
|
||||||
homeManagerModules = import ./modules/home-manager;
|
homeManagerModules = import ./modules/home-manager;
|
||||||
|
|
||||||
# NixOS configuration entrypoint
|
# NixOS configuration entrypoint
|
||||||
|
|||||||
@@ -1,4 +1,25 @@
|
|||||||
{ lib, config, pkgs, ... }: {
|
# This is your home-manager configuration file
|
||||||
|
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
|
||||||
|
|
||||||
|
{ inputs, outputs, lib, config, pkgs, ... }: {
|
||||||
|
imports = [
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs = {
|
||||||
|
overlays = [
|
||||||
|
# Add overlays your own flake exports (from overlays and pkgs dir):
|
||||||
|
outputs.overlays.additions
|
||||||
|
outputs.overlays.modifications
|
||||||
|
outputs.overlays.unstable-packages
|
||||||
|
];
|
||||||
|
# Configure your nixpkgs instance
|
||||||
|
config = {
|
||||||
|
# Disable if you don't want unfree packages
|
||||||
|
allowUnfree = true;
|
||||||
|
# Workaround for https://github.com/nix-community/home-manager/issues/2942
|
||||||
|
allowUnfreePredicate = (_: true);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
home.username = "sstent";
|
home.username = "sstent";
|
||||||
home.homeDirectory = "/home/sstent";
|
home.homeDirectory = "/home/sstent";
|
||||||
@@ -8,9 +29,9 @@
|
|||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
autossh
|
autossh
|
||||||
azure-cli
|
# azure-cli
|
||||||
ansible
|
ansible
|
||||||
sshpass
|
# sshpass
|
||||||
(import ./packages/python-packages.nix { pkgs = pkgs; })
|
(import ./packages/python-packages.nix { pkgs = pkgs; })
|
||||||
pyinfra
|
pyinfra
|
||||||
sshpass
|
sshpass
|
||||||
@@ -26,12 +47,13 @@
|
|||||||
mr
|
mr
|
||||||
perl
|
perl
|
||||||
# beets
|
# beets
|
||||||
qemu_kvm
|
# qemu_kvm
|
||||||
nixos-generators
|
# nixos-generators
|
||||||
nixfmt
|
nixfmt
|
||||||
deploy-rs
|
# deploy-rs
|
||||||
];
|
];
|
||||||
|
|
||||||
|
services.ssh-proxy.enable = true;
|
||||||
services.keybase.enable = true;
|
services.keybase.enable = true;
|
||||||
services.kbfs.enable = true;
|
services.kbfs.enable = true;
|
||||||
|
|
||||||
@@ -100,22 +122,22 @@ programs = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user = {
|
# systemd.user = {
|
||||||
|
|
||||||
startServices = true;
|
# startServices = true;
|
||||||
|
|
||||||
services.ssh-proxy = {
|
# services.ssh-proxy = {
|
||||||
Unit = { Description = "WSL Proxy"; };
|
# Unit = { Description = "WSL Proxy"; };
|
||||||
Service = {
|
# Service = {
|
||||||
ExecStart = "${pkgs.writeShellScript "start-proxy" ''
|
# ExecStart = "${pkgs.writeShellScript "start-proxy" ''
|
||||||
set -x
|
# set -x
|
||||||
${pkgs.coreutils}/bin/rm -f /home/sstent/.ssh/wsl-ssh-agent.sock
|
# ${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
|
||||||
''}";
|
# ''}";
|
||||||
};
|
# };
|
||||||
#Install = { WantedBy = [ "default.target" ]; };
|
# #Install = { WantedBy = [ "default.target" ]; };
|
||||||
};
|
# };
|
||||||
};
|
# };
|
||||||
}
|
}
|
||||||
|
|
||||||
# homeage = {
|
# homeage = {
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
# List your module files here
|
# List your module files here
|
||||||
# my-module = import ./my-module.nix;
|
ssh-proxy = import ./ssh-proxy.nix;
|
||||||
}
|
}
|
||||||
|
|||||||
43
modules/home-manager/ssh-proxy.nix
Normal file
43
modules/home-manager/ssh-proxy.nix
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{ lib, pkgs, config, ... }:
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let cfg = config.services.ssh-proxy;
|
||||||
|
in {
|
||||||
|
options.services.ssh-proxy = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Enable ssh-proxy for WSL
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
npiperelay
|
||||||
|
socat
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
systemd.user = {
|
||||||
|
|
||||||
|
startServices = true;
|
||||||
|
|
||||||
|
services.ssh-proxy = {
|
||||||
|
Unit = { Description = "WSL Proxy"; };
|
||||||
|
Service = {
|
||||||
|
ExecStart = "${pkgs.writeShellScript "start-proxy" ''
|
||||||
|
set -x
|
||||||
|
${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
|
||||||
|
''}";
|
||||||
|
};
|
||||||
|
#Install = { WantedBy = [ "default.target" ]; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user