mirror of
https://github.com/sstent/vmimages.git
synced 2026-02-04 19:42:22 +00:00
sync
This commit is contained in:
224
flake.nix
224
flake.nix
@@ -54,129 +54,125 @@
|
|||||||
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs =
|
||||||
self,
|
{ self
|
||||||
nixpkgs,
|
, nixpkgs
|
||||||
home-manager,
|
, home-manager
|
||||||
nixpkgs-unstable,
|
, nixpkgs-unstable
|
||||||
...
|
, ...
|
||||||
} @ inputs: let
|
} @ inputs:
|
||||||
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
let
|
||||||
inherit (self) outputs;
|
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
||||||
|
inherit (self) outputs;
|
||||||
|
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
mkPkgs = pkgs: extraOverlays:
|
pkgs = import nixpkgs {
|
||||||
import pkgs {
|
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true; # forgive me Stallman senpai
|
config.allowUnfree = true;
|
||||||
overlays = extraOverlays ++ (lib.attrValues self.overlays);
|
overlays = builtins.attrValues self.overlays;
|
||||||
};
|
};
|
||||||
# pkgs = mkPkgs nixpkgs [self.overlay];
|
|
||||||
pkgs = mkPkgs nixpkgs [];
|
|
||||||
# pkgs' = mkPkgs nixpkgs-unstable [];
|
|
||||||
|
|
||||||
lib =
|
|
||||||
nixpkgs.lib.extend
|
lib =
|
||||||
(self: super:
|
nixpkgs.lib.extend
|
||||||
{
|
(self: super:
|
||||||
my = import ./lib {
|
{
|
||||||
inherit pkgs inputs outputs;
|
my = import ./lib {
|
||||||
lib = self;
|
inherit pkgs inputs outputs;
|
||||||
|
lib = self;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// home-manager.lib);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
lib = lib.my;
|
||||||
|
packages."${system}" = mapModules ./pkgs (p: pkgs.callPackage p { });
|
||||||
|
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
|
||||||
|
|
||||||
|
devShell."${system}" =
|
||||||
|
import ./shell.nix { inherit pkgs; };
|
||||||
|
|
||||||
|
|
||||||
|
##Loads all overlays in the default.nix
|
||||||
|
##This gets used as an input to the pkg definitiosn
|
||||||
|
overlays = import ./overlays { inherit inputs; };
|
||||||
|
|
||||||
|
# Output all NixOS modules in ./modules/nixos to flake. Modules should be in
|
||||||
|
# individual subdirectories and contain a default.nix file
|
||||||
|
nixosModules = builtins.listToAttrs (map
|
||||||
|
(x: {
|
||||||
|
name = x;
|
||||||
|
value = import (./modules/nixos + "/${x}");
|
||||||
|
})
|
||||||
|
(builtins.attrNames (builtins.readDir ./modules/nixos)));
|
||||||
|
|
||||||
|
##import our HM modulesin ./modules/home-manager to flake. Modules should be in
|
||||||
|
# individual subdirectories and contain a default.nix file
|
||||||
|
homeManagerModules = builtins.listToAttrs (map
|
||||||
|
(name: {
|
||||||
|
inherit name;
|
||||||
|
value = import (./modules/home-manager + "/${name}");
|
||||||
|
})
|
||||||
|
(builtins.attrNames (builtins.readDir ./modules/home-manager)));
|
||||||
|
|
||||||
|
# nixosConfigurations =
|
||||||
|
# mapHosts ./hosts {};
|
||||||
|
|
||||||
|
# NixOS configuration entrypoint
|
||||||
|
nixosConfigurations = {
|
||||||
|
go3-wsl = nixpkgs.lib.nixosSystem {
|
||||||
|
pkgs = pkgs;
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs outputs lib;
|
||||||
|
hostName = "go3-wsl";
|
||||||
};
|
};
|
||||||
}
|
modules = [
|
||||||
// home-manager.lib);
|
./hosts/go3-wsl
|
||||||
in {
|
];
|
||||||
lib = lib.my;
|
};
|
||||||
packages."${system}" = mapModules ./pkgs (p: pkgs.callPackage p {});
|
StuPC-WSL = nixpkgs.lib.nixosSystem {
|
||||||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
|
pkgs = pkgs;
|
||||||
|
specialArgs = {
|
||||||
devShell."${system}" =
|
inherit inputs outputs lib;
|
||||||
import ./shell.nix {inherit pkgs;};
|
hostName = "StuPC";
|
||||||
|
};
|
||||||
# overlay = final: prev: {
|
modules = [
|
||||||
# unstable = pkgs';
|
./hosts/StuPC-WSL
|
||||||
# my = self.packages."${system}";
|
];
|
||||||
# keybase = pkgs'.keybase;
|
|
||||||
# };
|
|
||||||
|
|
||||||
overlays = import ./overlays {inherit inputs;};
|
|
||||||
|
|
||||||
# Output all modules in ./modules to flake. Modules should be in
|
|
||||||
# individual subdirectories and contain a default.nix file
|
|
||||||
nixosModules = builtins.listToAttrs (map
|
|
||||||
(x: {
|
|
||||||
name = x;
|
|
||||||
value = import (./modules/nixos + "/${x}");
|
|
||||||
})
|
|
||||||
(builtins.attrNames (builtins.readDir ./modules/nixos)));
|
|
||||||
|
|
||||||
##import our HM modules
|
|
||||||
## -- imported in ./home-manger/general
|
|
||||||
|
|
||||||
homeManagerModules = builtins.listToAttrs (map
|
|
||||||
(name: {
|
|
||||||
inherit name;
|
|
||||||
value = import (./modules/home-manager + "/${name}");
|
|
||||||
})
|
|
||||||
(builtins.attrNames (builtins.readDir ./modules/home-manager)));
|
|
||||||
|
|
||||||
# nixosConfigurations =
|
|
||||||
# mapHosts ./hosts {};
|
|
||||||
|
|
||||||
# NixOS configuration entrypoint
|
|
||||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
|
||||||
nixosConfigurations = {
|
|
||||||
go3-wsl = nixpkgs.lib.nixosSystem {
|
|
||||||
specialArgs = {
|
|
||||||
inherit inputs outputs lib;
|
|
||||||
hostName = "go3-wsl";
|
|
||||||
};
|
};
|
||||||
modules = [
|
|
||||||
./hosts/go3-wsl
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
StuPC-WSL = nixpkgs.lib.nixosSystem {
|
|
||||||
specialArgs = {
|
# Standalone home-manager configuration entrypoint
|
||||||
inherit inputs outputs lib;
|
# Available through 'home-manager --flake .#your-username@your-hostname'
|
||||||
hostName = "StuPC";
|
homeConfigurations = {
|
||||||
|
# FIXME replace with your username@hostname
|
||||||
|
"sstent@go3-wsl" = home-manager.lib.homeManagerConfiguration {
|
||||||
|
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||||
|
pkgs = pkgs;
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit inputs outputs lib;
|
||||||
|
hostName = "go3-wsl";
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
# > Our main home-manager configuration file <
|
||||||
|
./home-manager/users/sstent
|
||||||
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"sstent@StuPC-WSL" = home-manager.lib.homeManagerConfiguration {
|
||||||
|
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||||
|
pkgs = pkgs;
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit inputs outputs lib;
|
||||||
|
hostName = "StuPC-WSL";
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
# > Our main home-manager configuration file <
|
||||||
|
./home-manager/users/sstent
|
||||||
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
|
];
|
||||||
};
|
};
|
||||||
modules = [
|
|
||||||
./hosts/StuPC-WSL
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Standalone home-manager configuration entrypoint
|
|
||||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
|
||||||
homeConfigurations = {
|
|
||||||
# FIXME replace with your username@hostname
|
|
||||||
"sstent@go3-wsl" = home-manager.lib.homeManagerConfiguration {
|
|
||||||
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
|
||||||
pkgs = pkgs;
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs outputs lib;
|
|
||||||
hostName = "go3-wsl";
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
# > Our main home-manager configuration file <
|
|
||||||
./home-manager/users/sstent
|
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
|
||||||
];
|
|
||||||
};
|
|
||||||
"sstent@StuPC-WSL" = home-manager.lib.homeManagerConfiguration {
|
|
||||||
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
|
||||||
pkgs = pkgs;
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs outputs lib;
|
|
||||||
hostName = "StuPC-WSL";
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
# > Our main home-manager configuration file <
|
|
||||||
./home-manager/users/sstent
|
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,13 +36,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
nixpkgs = {
|
# nixpkgs = {
|
||||||
overlays = builtins.attrValues outputs.overlays;
|
# overlays = builtins.attrValues outputs.overlays;
|
||||||
config = {
|
# config = {
|
||||||
allowUnfree = true;
|
# allowUnfree = true;
|
||||||
allowUnfreePredicate = _: true;
|
# allowUnfreePredicate = _: true;
|
||||||
};
|
# };
|
||||||
};
|
# };
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
package = lib.mkDefault pkgs.nix;
|
package = lib.mkDefault pkgs.nix;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#home.file."/home/sstent/.config/bash-completions/mr.bash".source = ./mr_completion.bash;
|
#home.file."/home/sstent/.config/bash-completions/mr.bash".source = ./mr_completion.bash;
|
||||||
# home.file."/home/sstent/justfile".source = ./justfile;
|
# home.file."/home/sstent/justfile".source = ./justfile;
|
||||||
home.file."/home/sstent/justfile".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/vmimages/dotfiles/${config.home.username}/justfile";
|
home.file."/home/sstent/justfile".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/vmimages/dotfiles/${config.home.username}/justfile";
|
||||||
home.file."/home/sstent/.config/bash-completions/nomad_.bash".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/vmimages/dotfiles/${config.home.username}/nomad_.bash";
|
home.file.".bash_completion".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/vmimages/dotfiles/${config.home.username}/nomad_.bash";
|
||||||
|
|
||||||
# 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;
|
||||||
|
|
||||||
|
|||||||
@@ -51,28 +51,21 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
programs.fuse.userAllowOther = true;
|
programs.fuse.userAllowOther = true;
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
|
|
||||||
nixpkgs.overlays = builtins.attrValues outputs.overlays;
|
|
||||||
# nixpkgs.overlays = [
|
|
||||||
# outputs.overlays.unstable-packages
|
|
||||||
# outputs.overlays.modifications
|
|
||||||
# outputs.overlays.additions
|
|
||||||
# ];
|
|
||||||
# Enable nix flakes
|
# Enable nix flakes
|
||||||
nix.package = pkgs.nixFlakes;
|
nix.package = pkgs.nixFlakes;
|
||||||
nix.extraOptions = ''
|
nix.extraOptions = ''
|
||||||
experimental-features = nix-command flakes
|
experimental-features = nix-command flakes
|
||||||
'';
|
'';
|
||||||
nix.nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
nix.nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
||||||
# nix.nixPath = [ "nixpkgs=pkgs.outPath" ];
|
|
||||||
networking.search = ["node.dc1.consul" "service.dc1.consul"];
|
|
||||||
networking.nameservers = ["192.168.1.1" "1.1.1.1"];
|
|
||||||
# Enable networking
|
# Enable networking
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
networking.search = ["node.dc1.consul" "service.dc1.consul"];
|
||||||
|
networking.nameservers = ["192.168.1.1" "1.1.1.1"];
|
||||||
|
|
||||||
# Select internationalisation properties.
|
# Select internationalisation properties.
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|||||||
@@ -1,179 +0,0 @@
|
|||||||
<<<<<<< HEAD
|
|
||||||
# This file (and the global directory) holds config that i use on all hosts
|
|
||||||
{
|
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
outputs,
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports =
|
|
||||||
[
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
]
|
|
||||||
++ (builtins.attrValues outputs.nixosModules);
|
|
||||||
|
|
||||||
###dotfiles path variable
|
|
||||||
options._dotfiles = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "${inputs.self}/home-manager/dotfiles";
|
|
||||||
description = "Path to the dotfiles in this repository";
|
|
||||||
};
|
|
||||||
|
|
||||||
###secrets path variable
|
|
||||||
options._secrets = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "/run/user/1000/secrets";
|
|
||||||
description = "Path to the Secrets runtime";
|
|
||||||
};
|
|
||||||
|
|
||||||
###secretstore path variable
|
|
||||||
options._secretstore = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "${inputs.self}/secrets";
|
|
||||||
description = "Path to the Secrets storage";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
system.stateVersion = "23.05";
|
|
||||||
|
|
||||||
sops = {
|
|
||||||
defaultSopsFile = "${config._secretstore}/host-secrets.yaml";
|
|
||||||
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager = {
|
|
||||||
useUserPackages = true;
|
|
||||||
extraSpecialArgs = {inherit inputs outputs;};
|
|
||||||
sharedModules = [
|
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
programs.fuse.userAllowOther = true;
|
|
||||||
security.sudo.wheelNeedsPassword = false;
|
|
||||||
|
|
||||||
# nixpkgs.overlays = overlays;
|
|
||||||
# Enable nix flakes
|
|
||||||
nix.package = pkgs.nixFlakes;
|
|
||||||
nix.extraOptions = ''
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
'';
|
|
||||||
nix.nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
|
||||||
# nix.nixPath = [ "nixpkgs=pkgs.outPath" ];
|
|
||||||
networking.search = ["node.dc1.consul" "service.dc1.consul"];
|
|
||||||
|
|
||||||
#services.envfs.enable = true;
|
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.git
|
|
||||||
pkgs.home-manager
|
|
||||||
pkgs.sops
|
|
||||||
pkgs.ssh-to-age
|
|
||||||
pkgs.age
|
|
||||||
pkgs.bitwarden-cli
|
|
||||||
];
|
|
||||||
|
|
||||||
nix.gc = {
|
|
||||||
automatic = true; # Enable the automatic garbage collector
|
|
||||||
dates = "03:15"; # When to run the garbage collector
|
|
||||||
options = "-d"; # Arguments to pass to nix-collect-garbage
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
=======
|
|
||||||
# This file (and the global directory) holds config that i use on all hosts
|
|
||||||
{ lib, inputs, outputs, pkgs, config, ... }:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
# ./binfmt.nix
|
|
||||||
]++ (builtins.attrValues outputs.nixosModules);
|
|
||||||
|
|
||||||
###dotfiles path variable
|
|
||||||
options._dotfiles = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "${inputs.self}/home-manager/dotfiles";
|
|
||||||
description = "Path to the dotfiles in this repository";
|
|
||||||
};
|
|
||||||
|
|
||||||
###secrets path variable
|
|
||||||
options._secrets = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "/run/user/1000/secrets";
|
|
||||||
description = "Path to the Secrets runtime";
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
###secretstore path variable
|
|
||||||
options._secretstore = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "${inputs.self}/secrets";
|
|
||||||
description = "Path to the Secrets storage";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
system.stateVersion = "23.05";
|
|
||||||
|
|
||||||
|
|
||||||
sops = {
|
|
||||||
defaultSopsFile = "${config._secretstore}/host-secrets.yaml";
|
|
||||||
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
home-manager = {
|
|
||||||
useUserPackages = true;
|
|
||||||
extraSpecialArgs = { inherit inputs outputs; };
|
|
||||||
sharedModules = [
|
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
programs.fuse.userAllowOther = true;
|
|
||||||
security.sudo.wheelNeedsPassword = false;
|
|
||||||
|
|
||||||
# nixpkgs.overlays = overlays;
|
|
||||||
# Enable nix flakes
|
|
||||||
nix.package = pkgs.nixFlakes;
|
|
||||||
nix.extraOptions = ''
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
'';
|
|
||||||
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
|
||||||
# nix.extra-platforms = aarch64-linux i686-linux;
|
|
||||||
|
|
||||||
# nix.nixPath = [ "nixpkgs=pkgs.outPath" ];
|
|
||||||
# boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
|
||||||
boot.binfmt.emulatedSystems = ["armv7l-linux" "aarch64-linux"];
|
|
||||||
|
|
||||||
nix.settings.substituters = [
|
|
||||||
"https://fbleagh.cachix.org"
|
|
||||||
"https://cache.armv7l.xyz"
|
|
||||||
"https://arm.cachix.org"
|
|
||||||
"https://thefloweringash-armv7.cachix.org" ];
|
|
||||||
nix.settings.trusted-public-keys = [
|
|
||||||
"fbleagh.cachix.org-1:HNgEVkx9HfKmEQdR+9IeCwqFza0k8d8fJgcYvOTVDB8="
|
|
||||||
"cache.armv7l.xyz-1:kBY/eGnBAYiqYfg0fy0inWhshUo+pGFM3Pj7kIkmlBk="
|
|
||||||
"arm.cachix.org-1:K3XjAeWPgWkFtSS9ge5LJSLw3xgnNqyOaG7MDecmTQ8="
|
|
||||||
"thefloweringash-armv7.cachix.org-1:v+5yzBD2odFKeXbmC+OPWVqx4WVoIVO6UXgnSAWFtso="
|
|
||||||
];
|
|
||||||
nix.settings.trusted-users = [ "root" "sstent" ];
|
|
||||||
|
|
||||||
#services.envfs.enable = true;
|
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.git
|
|
||||||
pkgs.home-manager
|
|
||||||
pkgs.sops
|
|
||||||
pkgs.ssh-to-age
|
|
||||||
pkgs.age
|
|
||||||
pkgs.qemu
|
|
||||||
pkgs.cachix
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
>>>>>>> dacf7df (updates)
|
|
||||||
Reference in New Issue
Block a user