Compare commits

...

10 Commits

Author SHA1 Message Date
John Lancaster
afe391ef8e WIP 2024-12-09 17:38:18 -06:00
John Lancaster
fdb9d8717d fake email 2024-12-08 16:49:40 -06:00
John Lancaster
857aedca79 WIP change args 2024-12-08 16:41:48 -06:00
John Lancaster
3edc60fe84 impure 2024-12-08 16:37:10 -06:00
John Lancaster
7a1a40c2ae variables again 2024-12-08 16:36:08 -06:00
John Lancaster
d22763540a single home module 2024-12-08 16:34:11 -06:00
John Lancaster
fd21e90e1d removed comment 2024-12-08 16:32:32 -06:00
John Lancaster
138df54fbc more 2024-12-08 16:22:59 -06:00
John Lancaster
30c43f5488 pruning 2024-12-08 16:05:07 -06:00
John Lancaster
343c6a89db continuous reorg 2024-12-08 16:03:45 -06:00
6 changed files with 112 additions and 72 deletions

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, userSettings, systemSettings, ... }:
{ {
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
@@ -23,4 +23,14 @@
execWheelOnly = false; execWheelOnly = false;
wheelNeedsPassword = false; # allows sudo without password for those in the wheel group wheelNeedsPassword = false; # allows sudo without password for those in the wheel group
}; };
users.users.${userSettings.username} = {
isNormalUser = true;
uid = 1000;
extraGroups = [ "wheel" "networkmanager" ];
openssh.authorizedKeys.keyFiles = [ /root/.ssh/authorized_keys ];
};
time.timeZone = "${systemSettings.timeZone}";
networking.hostName = systemSettings.hostName;
} }

View File

@@ -1,5 +1,5 @@
{ {
description = "Loki flake config"; description = "Panoptes flake config";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
@@ -8,7 +8,6 @@
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# vscode-server.url = "path:./nixos/vscode";
vscode-server.url = "github:nix-community/nixos-vscode-server"; vscode-server.url = "github:nix-community/nixos-vscode-server";
}; };
@@ -20,39 +19,43 @@
... ...
} @ inputs: } @ inputs:
let let
stateVersion = "24.11";
inherit (self) outputs; inherit (self) outputs;
nixosSystem = inputs.nixpkgs.lib.nixosSystem;
userSettings = rec {
username = "panoptes";
gitUserName = "John Lancaster";
gitUserEmail = "32917998+jsl12@users.noreply.github.com";
# gitUserEmail = "asdfasdf@asdf.com";
};
systemSettings = rec {
hostName = "panoptes-nix";
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
stateVersion = "24.05";
# userSettings = rec {
# username = "shahvirb"; # username on the system
# name = "Shahvir"; # name/identifier on the system
# email = "shahvirb@gmail.com";
# gitUserName = "shahvirb";
# gitUserEmail = "shahvirb@gmail.com";
# };
timeZone = "America/Chicago"; timeZone = "America/Chicago";
hostname = "panoptes-nix"; locale = "en_US.UTF-8";
user = "panoptes"; };
pkgs = inputs.nixpkgs.legacyPackages.${systemSettings.system};
pkgs-stable = inputs.nixpkgs-stable.legacyPackages.${systemSettings.system};
in in
{ {
nixosConfigurations = { nixosConfigurations = {
${hostname} = nixpkgs.lib.nixosSystem { "${systemSettings.hostName}" = nixosSystem {
specialArgs = {inherit inputs outputs;}; system = systemSettings.system;
specialArgs = {
inherit inputs;
inherit outputs;
inherit userSettings;
inherit systemSettings;
};
modules = [ modules = [
./configuration.nix # > Our main nixos configuration file < ./configuration.nix # > Our main nixos configuration file <
"${nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix" "${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
({ ... }: { ({ ... }: {
nixpkgs.hostPlatform = "${system}";
system.stateVersion = "${stateVersion}"; system.stateVersion = "${stateVersion}";
time.timeZone = "${timeZone}";
users.users.${user} = {
extraGroups = [ "wheel" ];
isNormalUser = true;
openssh.authorizedKeys.keyFiles = [ /root/.ssh/authorized_keys ];
};
services.vscode-server.enable = true; services.vscode-server.enable = true;
}) })
inputs.vscode-server.nixosModules.default inputs.vscode-server.nixosModules.default
@@ -62,10 +65,18 @@
homeConfigurations = { homeConfigurations = {
useGlobalPkgs = true; useGlobalPkgs = true;
user = home-manager.lib.homeManagerConfiguration { "panoptes@panoptes-nix" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs stateVersion;
extraSpecialArgs = {inherit inputs outputs pkgs;}; specialArgs = {
modules = [ ./homeManagerModules/home.nix ]; inherit inputs;
inherit outputs;
inherit userSettings;
inherit systemSettings;
};
modules = [
./home.nix
# ({...}: {home.stateVersion = "${stateVersion}";})
];
}; };
}; };
}; };

41
home.nix Normal file
View File

@@ -0,0 +1,41 @@
{
pkgs,
systemSettings,
userSettings,
...
}:
let
homePath = "/srv/panoptes";
repoURL = "https://gitea.john-stream.com/john/loki-nix";
repoBranch = "reorg";
in
{
nixpkgs.config.allowUnfree = true;
programs.home-manager.enable = true;
programs.git = {
enable = true;
extraConfig.credential.helper = "store --file ~/.git-credentials";
userName = "${userSettings.gitUserName}";
userEmail = "${userSettings.gitUserEmail}";
extraConfig.safe.directory = "${homePath}";
};
programs.bash.enable = true;
programs.ssh.enable = true;
home = {
homeDirectory = "${homePath}";
packages = [
(pkgs.writeShellScriptBin "nfs" ''
sudo nixos-rebuild switch --flake ${homePath}#${hostName} --impure
'')
(pkgs.writeShellScriptBin "init-panoptes" ''
sudo -u git clone -b ${repoBranch} ${repoURL} /srv/panoptes
'')
git
];
};
systemd.user.startServices = "sd-switch";
}

View File

@@ -1,9 +0,0 @@
{ ... }:
{
programs.git = {
enable = true;
extraConfig.credential.helper = "store --file ~/.git-credentials";
userName = "John Lancaster";
userEmail = "32917998+jsl12@users.noreply.github.com";
};
}

View File

@@ -1,32 +0,0 @@
{
inputs,
lib,
config,
pkgs,
...
}:
let
homePath = "/srv/panoptes";
in
{
imports = [ ./git.nix ];
programs.git.extraConfig.safe.directory = "${homePath}";
programs.home-manager.enable = true;
home = {
stateVersion = "24.05";
# username = "${user}";
homeDirectory = "${homePath}";
packages = [
(pkgs.writeShellScriptBin "nfs" ''
sudo nixos-rebuild switch --flake git+file://${homePath}#${hostname}
'')
(pkgs.writeShellScriptBin "init-panoptes" ''
sudo -u git clone -b reorg https://gitea.john-stream.com/john/loki-nix /srv/panoptes
'')
git
];
};
systemd.user.startServices = "sd-switch";
}

19
nixosModules/default.nix Normal file
View File

@@ -0,0 +1,19 @@
{
pkgs,
config,
lib,
inputs,
outputs,
...
}: {
imports =
[
./services/loki.nix
];
config = {
nix.settings.experimental-features = ["nix-command" "flakes"];
programs.nix-ld.enable = true;
nixpkgs.config.allowUnfree = true;
};
}