Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
b317425657 |
|||
|
45b63706a4 |
17 changed files with 155 additions and 98 deletions
19
flake.lock
generated
19
flake.lock
generated
|
|
@ -173,7 +173,24 @@
|
|||
"nixpkgs-unstable"
|
||||
],
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"nvf": "nvf"
|
||||
"nvf": "nvf",
|
||||
"xcursor-plan9": "xcursor-plan9"
|
||||
}
|
||||
},
|
||||
"xcursor-plan9": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1714831058,
|
||||
"narHash": "sha256-74ykNDuknGdP6j+cS4ePtGTkGGLqQdpu54TuG7262QI=",
|
||||
"owner": "wintermute-cell",
|
||||
"repo": "xcursor-plan9",
|
||||
"rev": "e0a605c16aff63f8eb958a8415441bf82de09245",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "wintermute-cell",
|
||||
"repo": "xcursor-plan9",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -18,5 +18,9 @@
|
|||
url = "github:NotAShelf/nvf";
|
||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
xcursor-plan9 = {
|
||||
url = "github:wintermute-cell/xcursor-plan9";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
{inputs, ...}: {
|
||||
{
|
||||
inputs,
|
||||
systemConstants,
|
||||
...
|
||||
}: {
|
||||
flake-file.inputs = {
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
|
@ -8,5 +12,5 @@
|
|||
inputs.flake-parts.flakeModules.easyOverlay
|
||||
];
|
||||
|
||||
systems = ["x86_64-linux"];
|
||||
systems = systemConstants.infraSystems;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
{self, ...}: let
|
||||
imports = [self.modules.generic.systemConstants];
|
||||
in {
|
||||
flake.modules.generic.systemConstants = {config, lib, ...}: {
|
||||
options.systemConstants = lib.mkOption {
|
||||
type = lib.types.lazyAttrsOf lib.types.unspecified;
|
||||
default = {};
|
||||
};
|
||||
|
||||
config.systemConstants = {
|
||||
repositoryOwnerUsername = "asnev";
|
||||
repositoryOwnerEmail = "notasnev@proton.me";
|
||||
|
||||
nixpkgsStateVersion = "26.05";
|
||||
nixpkgsAllowUnfree = true;
|
||||
|
||||
homeManagerStateVersion = config.systemConstants.nixpkgsStateVersion;
|
||||
|
||||
primaryUserUsername = "coyote";
|
||||
primaryUserHomeDirectory = "/home/coyote";
|
||||
primaryUserId = 1000;
|
||||
|
||||
phostronHostname = "phostron";
|
||||
phostronHostPlatform = "x86_64-linux";
|
||||
phostronStateVersion = config.systemConstants.nixpkgsStateVersion;
|
||||
};
|
||||
};
|
||||
|
||||
perSystem = {inherit imports;};
|
||||
flake.modules = {
|
||||
nixos.base = {inherit imports;};
|
||||
homeManager.primaryUser = {inherit imports;};
|
||||
};
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
(bottles.override {removeWarningPopup = true;})
|
||||
# development
|
||||
emacs
|
||||
unstable.racket
|
||||
unstable.guile
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
{
|
||||
flake.modules.homeManager.primaryUser = {config, ...}: {
|
||||
{systemConstants, ...}: {
|
||||
flake.modules.homeManager.primaryUser = {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
settings = {
|
||||
user.name = config.systemConstants.repositoryOwnerUsername;
|
||||
user.email = config.systemConstants.repositoryOwnerEmail;
|
||||
user.name = systemConstants.repositoryOwnerUsername;
|
||||
user.email = systemConstants.repositoryOwnerEmail;
|
||||
};
|
||||
|
||||
signing = {
|
||||
key = "${config.systemConstants.primaryUserHomeDirectory}/.ssh/id_ed25519.pub";
|
||||
key = "${systemConstants.primaryUserHomeDirectory}/.ssh/id_ed25519.pub";
|
||||
format = "ssh";
|
||||
};
|
||||
|
||||
includes = [
|
||||
{
|
||||
condition = "gitdir:${config.systemConstants.primaryUserHomeDirectory}/NixOS/";
|
||||
contents.core.sshCommand = "ssh -i ${config.systemConstants.primaryUserHomeDirectory}/.ssh/id_ed25519";
|
||||
condition = "gitdir:${systemConstants.primaryUserInfraDirectory}";
|
||||
contents.core.sshCommand = "ssh -i ${systemConstants.primaryUserHomeDirectory}/.ssh/id_ed25519";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -35,6 +35,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
visuals = {
|
||||
rainbow-delimiters.enable = true;
|
||||
};
|
||||
|
||||
clipboard = {
|
||||
enable = true;
|
||||
registers = "unnamedplus";
|
||||
|
|
@ -104,7 +108,7 @@
|
|||
mode = "i";
|
||||
key = "<C-l>";
|
||||
action = "λ";
|
||||
desc = "inserts lambda";
|
||||
desc = "inserts lowercase lambda";
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,13 @@
|
|||
{
|
||||
self,
|
||||
inputs,
|
||||
self,
|
||||
systemConstants,
|
||||
...
|
||||
}: {
|
||||
flake.modules.nixos.phostron = {
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
networking.hostName = config.systemConstants.phostronHostname;
|
||||
nixpkgs.hostPlatform = lib.mkDefault config.systemConstants.phostronHostPlatform;
|
||||
system.stateVersion = config.systemConstants.phostronStateVersion;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.primaryUser = {config, ...}: {
|
||||
home.stateVersion = config.systemConstants.phostronStateVersion;
|
||||
flake.modules.nixos.phostron = {lib, ...}: {
|
||||
networking.hostName = systemConstants.phostronHostname;
|
||||
nixpkgs.hostPlatform = lib.mkDefault systemConstants.phostronHostPlatform;
|
||||
system.stateVersion = systemConstants.phostronStateVersion;
|
||||
};
|
||||
|
||||
flake.nixosConfigurations.phostron = inputs.nixpkgs.lib.nixosSystem {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
{inputs, ...}: {
|
||||
{
|
||||
inputs,
|
||||
systemConstants,
|
||||
...
|
||||
}: {
|
||||
flake-file.inputs.home-manager = {
|
||||
url = "github:nix-community/home-manager/release-26.05";
|
||||
url = "github:nix-community/home-manager/release-${systemConstants.homeManagerStateVersion}";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
|
|
|
|||
5
modules/nixos/programs/nh.nix
Normal file
5
modules/nixos/programs/nh.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
flake.modules.nixos.base = {
|
||||
programs.nh.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
flake.modules.nixos.base = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
nh
|
||||
alejandra
|
||||
git
|
||||
python315
|
||||
# system utils
|
||||
file
|
||||
|
|
|
|||
|
|
@ -1,37 +1,23 @@
|
|||
{
|
||||
inputs,
|
||||
self,
|
||||
systemConstants,
|
||||
...
|
||||
}: let
|
||||
overlays = [self.overlays.default];
|
||||
overlays = systemConstants.nixpkgsOverlays;
|
||||
config = {allowUnfree = systemConstants.nixpkgsAllowUnfree;};
|
||||
in {
|
||||
flake-file.inputs = {
|
||||
nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst";
|
||||
nixpkgs.url = "https://channels.nixos.org/nixos-${systemConstants.nixpkgsStableVersion}/nixexprs.tar.zst";
|
||||
nixpkgs-unstable.url = "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1100280.3ec636362e18/nixexprs.tar.zst";
|
||||
nixpkgs-lib.follows = "nixpkgs-unstable";
|
||||
};
|
||||
|
||||
perSystem = {
|
||||
config,
|
||||
final,
|
||||
system,
|
||||
...
|
||||
}: {
|
||||
_module.args.pkgs = import inputs.nixpkgs {
|
||||
inherit system overlays;
|
||||
config.allowUnfree = config.systemConstants.nixpkgsAllowUnfree;
|
||||
};
|
||||
|
||||
overlayAttrs.unstable = import inputs.nixpkgs-unstable {
|
||||
inherit system;
|
||||
config.allowUnfree = config.systemConstants.nixpkgsAllowUnfree;
|
||||
};
|
||||
perSystem = {system, ...}: {
|
||||
_module.args.pkgs = import inputs.nixpkgs {inherit system overlays config;};
|
||||
overlayAttrs.unstable = import inputs.nixpkgs-unstable {inherit system config;};
|
||||
};
|
||||
|
||||
flake.modules.nixos.base = {config, ...}: {
|
||||
nixpkgs = {
|
||||
inherit overlays;
|
||||
config.allowUnfree = config.systemConstants.nixpkgsAllowUnfree;
|
||||
};
|
||||
flake.modules.nixos.base = {
|
||||
nixpkgs = {inherit overlays config;};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
20
modules/packages/xcursor-plan9.nix
Normal file
20
modules/packages/xcursor-plan9.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{inputs, ...}: {
|
||||
flake-file.inputs = {
|
||||
xcursor-plan9 = {
|
||||
url = "github:wintermute-cell/xcursor-plan9";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
perSystem = {
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
packages.xcursor-plan9 =
|
||||
(pkgs.callPackage (inputs.xcursor-plan9 + "/default.nix") {} )
|
||||
.overrideAttrs (_: {src = inputs.xcursor-plan9;});
|
||||
|
||||
overlayAttrs = {inherit (config.packages) xcursor-plan9;};
|
||||
};
|
||||
}
|
||||
5
modules/repository/fmt.nix
Normal file
5
modules/repository/fmt.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
perSystem = {pkgs, ...}: {
|
||||
formatter = pkgs.alejandra;
|
||||
};
|
||||
}
|
||||
8
modules/shells/direnv.nix
Normal file
8
modules/shells/direnv.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
flake.modules.nixos.base = {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
39
modules/system-constants.nix
Normal file
39
modules/system-constants.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
options.systemConstants = lib.mkOption {
|
||||
type = lib.types.lazyAttrsOf lib.types.unspecified;
|
||||
default = {};
|
||||
};
|
||||
|
||||
config.systemConstants = rec {
|
||||
infraName = "chitin";
|
||||
infraSystems = ["x86_64-linux"];
|
||||
|
||||
repositoryOwnerUsername = "asnev";
|
||||
repositoryOwnerEmail = "notasnev@proton.me";
|
||||
|
||||
nixpkgsStableVersion = "26.05";
|
||||
nixpkgsAllowUnfree = true;
|
||||
nixpkgsOverlays = [self.overlays.default];
|
||||
|
||||
phostronHostname = "phostron";
|
||||
phostronHostPlatform = lib.elemAt infraSystems 0;
|
||||
phostronStateVersion = nixpkgsStableVersion;
|
||||
|
||||
homeManagerStateVersion = nixpkgsStableVersion;
|
||||
|
||||
primaryUserUsername = "coyote";
|
||||
primaryUserHomeDirectory =
|
||||
if lib.hasSuffix "linux" phostronHostPlatform
|
||||
then "/home/${primaryUserUsername}"
|
||||
else throw "Unsupported platform. See `modules/system-constants.nix`.";
|
||||
primaryUserInfraDirectory = "${primaryUserHomeDirectory}/code/${infraName}";
|
||||
primaryUserId = 1000;
|
||||
};
|
||||
|
||||
config._module.args.systemConstants = config.systemConstants;
|
||||
}
|
||||
|
|
@ -1,10 +1,14 @@
|
|||
{self, ...}: {
|
||||
flake.modules.nixos.primaryUser = {config, ...}: {
|
||||
users.users.${config.systemConstants.primaryUserUsername} = {
|
||||
{
|
||||
self,
|
||||
systemConstants,
|
||||
...
|
||||
}: {
|
||||
flake.modules.nixos.primaryUser = {
|
||||
users.users.${systemConstants.primaryUserUsername} = {
|
||||
isNormalUser = true;
|
||||
description = config.systemConstants.primaryUserUsername;
|
||||
home = config.systemConstants.primaryUserHomeDirectory;
|
||||
uid = config.systemConstants.primaryUserId;
|
||||
description = systemConstants.primaryUserUsername;
|
||||
home = systemConstants.primaryUserHomeDirectory;
|
||||
uid = systemConstants.primaryUserId;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
|
|
@ -19,15 +23,16 @@
|
|||
};
|
||||
};
|
||||
|
||||
flake.modules.nixos.homeManagerModule = {config, ...}: {
|
||||
home-manager.users.${config.systemConstants.primaryUserUsername} = self.modules.homeManager.primaryUser;
|
||||
flake.modules.nixos.homeManagerModule = {
|
||||
home-manager.users.${systemConstants.primaryUserUsername} = self.modules.homeManager.primaryUser;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.primaryUser = {config, ...}: {
|
||||
flake.modules.homeManager.primaryUser = {
|
||||
home = {
|
||||
username = config.systemConstants.primaryUserUsername;
|
||||
homeDirectory = config.systemConstants.primaryUserHomeDirectory;
|
||||
username = systemConstants.primaryUserUsername;
|
||||
homeDirectory = systemConstants.primaryUserHomeDirectory;
|
||||
shell.enableShellIntegration = true;
|
||||
stateVersion = systemConstants.homeManagerStateVersion;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue