Compare commits
10 Commits
9334d2cc7f
...
afe391ef8e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afe391ef8e | ||
|
|
fdb9d8717d | ||
|
|
857aedca79 | ||
|
|
3edc60fe84 | ||
|
|
7a1a40c2ae | ||
|
|
d22763540a | ||
|
|
fd21e90e1d | ||
|
|
138df54fbc | ||
|
|
30c43f5488 | ||
|
|
343c6a89db |
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, userSettings, systemSettings, ... }:
|
||||
{
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
@@ -23,4 +23,14 @@
|
||||
execWheelOnly = false;
|
||||
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;
|
||||
}
|
||||
|
||||
69
flake.nix
69
flake.nix
@@ -1,5 +1,5 @@
|
||||
{
|
||||
description = "Loki flake config";
|
||||
description = "Panoptes flake config";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
@@ -8,7 +8,6 @@
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# vscode-server.url = "path:./nixos/vscode";
|
||||
vscode-server.url = "github:nix-community/nixos-vscode-server";
|
||||
};
|
||||
|
||||
@@ -20,39 +19,43 @@
|
||||
...
|
||||
} @ inputs:
|
||||
let
|
||||
stateVersion = "24.11";
|
||||
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";
|
||||
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";
|
||||
hostname = "panoptes-nix";
|
||||
user = "panoptes";
|
||||
locale = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
pkgs = inputs.nixpkgs.legacyPackages.${systemSettings.system};
|
||||
pkgs-stable = inputs.nixpkgs-stable.legacyPackages.${systemSettings.system};
|
||||
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
${hostname} = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
"${systemSettings.hostName}" = nixosSystem {
|
||||
system = systemSettings.system;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit outputs;
|
||||
inherit userSettings;
|
||||
inherit systemSettings;
|
||||
};
|
||||
modules = [
|
||||
./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}";
|
||||
time.timeZone = "${timeZone}";
|
||||
users.users.${user} = {
|
||||
extraGroups = [ "wheel" ];
|
||||
isNormalUser = true;
|
||||
openssh.authorizedKeys.keyFiles = [ /root/.ssh/authorized_keys ];
|
||||
};
|
||||
services.vscode-server.enable = true;
|
||||
})
|
||||
inputs.vscode-server.nixosModules.default
|
||||
@@ -62,10 +65,18 @@
|
||||
|
||||
homeConfigurations = {
|
||||
useGlobalPkgs = true;
|
||||
user = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
extraSpecialArgs = {inherit inputs outputs pkgs;};
|
||||
modules = [ ./homeManagerModules/home.nix ];
|
||||
"panoptes@panoptes-nix" = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs stateVersion;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit outputs;
|
||||
inherit userSettings;
|
||||
inherit systemSettings;
|
||||
};
|
||||
modules = [
|
||||
./home.nix
|
||||
# ({...}: {home.stateVersion = "${stateVersion}";})
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
41
home.nix
Normal file
41
home.nix
Normal 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";
|
||||
}
|
||||
@@ -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";
|
||||
};
|
||||
}
|
||||
@@ -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
19
nixosModules/default.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user