rearranging file structure

This commit is contained in:
Steven 2023-03-26 14:33:08 -04:00
parent 99a5a2ceeb
commit 42c2886813
5 changed files with 121 additions and 66 deletions

View file

@ -1,35 +0,0 @@
{config}:
{
# Don't allow mutation of users outside of the config.
users.mutableUsers = false;
# Set a root password, consider using initialHashedPassword instead.
#
# To generate a hash to put in initialHashedPassword
# you can do this:
# $ nix-shell --run 'mkpasswd -m SHA-512 -s' -p mkpasswd
users.users.root.initialPassword = "hunter2";
# machine-id is used by systemd for the journal, if you don't
# persist this file you won't be able to easily use journalctl to
# look at journals for previous boots.
environment.etc."machine-id".source
= "/nix/persist/etc/machine-id";
# if you want to run an openssh daemon, you may want to store the
# host keys across reboots.
#
# For this to work you will need to create the directory yourself:
# $ mkdir /nix/persist/etc/ssh
environment.etc."ssh/ssh_host_rsa_key".source
= "/nix/persist/etc/ssh/ssh_host_rsa_key";
environment.etc."ssh/ssh_host_rsa_key.pub".source
= "/nix/persist/etc/ssh/ssh_host_rsa_key.pub";
environment.etc."ssh/ssh_host_ed25519_key".source
= "/nix/persist/etc/ssh/ssh_host_ed25519_key";
environment.etc."ssh/ssh_host_ed25519_key.pub".source
= "/nix/persist/etc/ssh/ssh_host_ed25519_key.pub";
}

View file

@ -1,64 +1,94 @@
{
description = "respec's nixos configs";
inputs = {
# For NixOS #
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
# NixOS Hardware Configuration for framework #
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# For Wayfire #
# nixpkgs-wayland = {
# url = "github:nix-community/nixpkgs-wayland";
# inputs.nixpkgs.follows = "nixpkgs";
# };
# For Home Manager #
home-manager = {
url = "github:nix-community/home-manager/release-22.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
# For Disko Disk Provisioning #
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
# For Secrets Management #
sops-nix.url = github:Mic92/sops-nix;
};
outputs = { self, home-manager, nixos-generators, nixos-hardware, disko, nixpkgs, ... }@inputs:
outputs = { self, home-manager, nixos-hardware, disko, nixpkgs, sops-nix, ... }@inputs:
{
defaultPackage.x86_64-linux = home-manager.defaultPackage.x86_64-linux;
proxmox = nixos-generators.nixosGenerate {
system = "x86_64-linux";
modules = [
./hosts/creatorforge.nix
];
format = "proxmox";
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
defaultPackage.x86_64-linux = home-manager.defaultPackage.x86_64-linux;
defaultNixOptions = {
nix.autoOptimiseStore = true;
};
mkComputer = configurationNix: userName: extraModules: extraHomeModules: inputs.nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit system inputs pkgs nixos-hardware; };
modules = [
#Secrets management
sops-nix.nixosModules.sops
#Machine config
configurationNix
defaultNixOptions
#User config
(./. + "/users/${userName}")
#Home manager
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."${userName}" = {
imports = [ (./. + "/users/${userName}/home.nix") ] ++ extraHomeModules;
};
}
] ++ extraModules;
};
in
{
nixosConfigurations = {
creatorforge-vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
creatorforge-vm = mkComputer
./machines/proxmox-vm.nix #machine specific configuration
"speccon18" #default user
[
./hosts/creatorforge.nix
./.modules/base/proxmox-vm-hardware.nix
];
};
creatorforge-framework = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
] #modules to load
[]; #modules to be loaded by home-manager
creatorforge-framework = mkComputer
./machines/framework.nix #machine specific configuration
"speccon18" #default user
[
nixos-hardware.nixosModules.framework-12th-gen-intel
disko.nixosModules.disko
./hosts/creatorforge.nix
./.modules/base/framework.nix
];
};
] #modules to load
[]; #modules to be loaded by home-manager
};
homeConfigurations = {
speccon18 = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [ ./.hm-modules/home-manager.nix];
# username = "speccon18";
# homeDirectory = "/home/speccon18";
# configuration = {
# imports = [
# ./.hm-modules/home-manager.nix
# ];
# };
};
};
};

60
users/speccon18.nix Normal file
View file

@ -0,0 +1,60 @@
{ pkgs, config, ... }: {
#Home manager configuration
home.username = "speccon18";
home.homeDirectory = "/home/speccon18";
imports = [ ./../../home ./../../home/nixos ];
home.packages = with pkgs; [
loc
element-desktop
discord
bat
exa
nodejs-18_x
spotify
dig
nerdfonts
age
sops
steam-run
fira-code
libreoffice
asciinema
postman
gimp
rustup
neofetch
htop
vlc
polymc
remmina
signal-desktop
];
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
programs.home-manager.enable = true;
programs.vscode = {
enable = true;
package = pkgs.vscode;
};
programs.git = {
enable = true;
userName = "specCon18";
userEmail = "steven.carpenter@skdevstudios.com";
delta.enable = true;
extraConfig = {
init = {
defaultBranch = "main";
};
};
};
dconf.settings = {
"org/gnome/mutter" = {
experimental-features = [ "x11-randr-fractional-scaling" ];
};
};
}