Compare commits
No commits in common. "96e14ada2013e85aea6226b77770a9b7e4c987f7" and "509e11192a33e36e9028ba5c952ae2717dd7425b" have entirely different histories.
96e14ada20
...
509e11192a
3 changed files with 56 additions and 125 deletions
60
flake.lock
generated
60
flake.lock
generated
|
@ -1,35 +1,5 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"all-systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"darwin-systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1689347925,
|
|
||||||
"narHash": "sha256-ozenz5bFe1UUqOn7f60HRmgc01BgTGIKZ4Xl+HbocGQ=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default-darwin",
|
|
||||||
"rev": "2235d7e6cc29ae99878133c95e9fe5e157661ffb",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default-darwin",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -37,11 +7,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1712759992,
|
"lastModified": 1712212014,
|
||||||
"narHash": "sha256-2APpO3ZW4idlgtlb8hB04u/rmIcKA8O7pYqxF66xbNY=",
|
"narHash": "sha256-s+lbaf3nLRn1++/X2eXwY9mYCA/m9l8AvyG8beeOaXE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "31357486b0ef6f4e161e002b6893eeb4fafc3ca9",
|
"rev": "7e91f2a0ba4b62b88591279d54f741a13e36245b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -50,28 +20,13 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"linux-systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1689347949,
|
|
||||||
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default-linux",
|
|
||||||
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default-linux",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1712608508,
|
"lastModified": 1712163089,
|
||||||
"narHash": "sha256-vMZ5603yU0wxgyQeHJryOI+O61yrX2AHwY6LOFyV1gM=",
|
"narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "4cba8b53da471aea2ab2b0c1f30a81e7c451f4b6",
|
"rev": "fd281bd6b7d3e32ddfa399853946f782553163b5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -83,10 +38,7 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"all-systems": "all-systems",
|
|
||||||
"darwin-systems": "darwin-systems",
|
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"linux-systems": "linux-systems",
|
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
102
flake.nix
102
flake.nix
|
@ -4,26 +4,14 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
# Specify the source of Home Manager and Nixpkgs.
|
# Specify the source of Home Manager and Nixpkgs.
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
# Allows for easy enumeration of available Darwin and Linux systems.
|
|
||||||
all-systems.url = "github:nix-systems/default";
|
|
||||||
darwin-systems.url = "github:nix-systems/default-darwin";
|
|
||||||
linux-systems.url = "github:nix-systems/default-linux";
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixpkgs, home-manager, linux-systems, darwin-systems, all-systems, ... }:
|
outputs = { nixpkgs, home-manager, ... }:
|
||||||
let
|
let
|
||||||
# TODO(spotlightishere): Is there a better way to approach this that doesn't
|
|
||||||
# involve importing so many separate flakes?
|
|
||||||
#
|
|
||||||
# (We could manually merge Darwin and Linux themselves, but this is primarily for readability.)
|
|
||||||
allSystems = nixpkgs.lib.genAttrs (import all-systems);
|
|
||||||
darwinSystems = nixpkgs.lib.genAttrs (import darwin-systems);
|
|
||||||
linuxSystems = nixpkgs.lib.genAttrs (import linux-systems);
|
|
||||||
|
|
||||||
homeManager = { system, specialArgs ? { } }:
|
homeManager = { system, specialArgs ? { } }:
|
||||||
home-manager.lib.homeManagerConfiguration {
|
home-manager.lib.homeManagerConfiguration {
|
||||||
modules = [
|
modules = [
|
||||||
|
@ -34,72 +22,64 @@
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# There's a few things going on here that are all merged in the end.
|
packages = {
|
||||||
# We start with system-specific packages, providing home-manager.
|
# We currently assume that all x86_64-linux devices only
|
||||||
packages =
|
# require dotfiles. For now, this is mostly true :)
|
||||||
##########################
|
x86_64-linux.homeConfigurations.spotlight = homeManager {
|
||||||
# Linux-specific options #
|
system = "x86_64-linux";
|
||||||
##########################
|
};
|
||||||
linuxSystems
|
|
||||||
(system: {
|
# Similarly (as of writing), all aarch64 Linux devices are headless
|
||||||
homeConfigurations = {
|
# and primarily managed by other distro package managers.
|
||||||
# First, we currently assume that Linux devices
|
# This should likely be dealt with in the future!
|
||||||
# only require dotfiles and utilize the username `spotlight`.
|
aarch64-linux.homeConfigurations.spotlight = homeManager {
|
||||||
#
|
system = "aarch64-linux";
|
||||||
# For now, this is effectively true, sans a few specific configurations :)
|
};
|
||||||
spotlight = homeManager {
|
|
||||||
system = system;
|
# For all architecture variants of Darwin, we don't want only dotfiles.
|
||||||
|
aarch64-darwin.homeConfigurations.spot = homeManager {
|
||||||
|
system = "aarch64-darwin";
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
desktop = false;
|
desktop = true;
|
||||||
gpg = false;
|
gpg = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
x86_64-darwin.homeConfigurations.spot = homeManager {
|
||||||
|
system = "x86_64-darwin";
|
||||||
|
specialArgs = {
|
||||||
|
desktop = true;
|
||||||
|
gpg = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# For a special case: with the Steam Deck, we have to assume the user
|
# For a special case: with the Steam Deck, we have to assume the user
|
||||||
# is named `deck` due to its immutable system image.
|
# is named `deck` due to its immutable system image.
|
||||||
deck = homeManager {
|
x86_64-linux.homeConfigurations.deck = homeManager {
|
||||||
system = system;
|
system = "x86_64-linux";
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
gpg = true;
|
gpg = true;
|
||||||
username = "deck";
|
username = "deck";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
###########################
|
|
||||||
# Darwin-specific options #
|
|
||||||
###########################
|
|
||||||
darwinSystems (system: {
|
|
||||||
# We use the username `spot` under Darwin.
|
|
||||||
# We also assume that desktop applications should be made available, alongside GPG.
|
|
||||||
homeConfigurations.spot = homeManager {
|
|
||||||
system = system;
|
|
||||||
specialArgs = {
|
|
||||||
desktop = true;
|
|
||||||
gpg = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
# We provide a NixOS module for easy usage within other system flakes.
|
|
||||||
# (Again, we assume a default name of `spotlight` under Linux.)
|
|
||||||
nixosModules.default = {
|
nixosModules.default = {
|
||||||
imports = [
|
imports = [
|
||||||
home-manager.nixosModules.home-manager {
|
home-manager.nixosModules.home-manager
|
||||||
home-manager = {
|
{
|
||||||
useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
users.spotlight = import ./home/home.nix;
|
home-manager.users.spotlight = import ./home/home.nix;
|
||||||
extraSpecialArgs = { desktop = false; gpg = false; };
|
home-manager.extraSpecialArgs = { desktop = false; gpg = false; };
|
||||||
};
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Lastly, ensure a formatter is available for all systems.
|
formatter = {
|
||||||
formatter = allSystems (system: nixpkgs.legacyPackages.${system}.nixpkgs-fmt);
|
aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixpkgs-fmt;
|
||||||
|
x86_64-darwin = nixpkgs.legacyPackages.x86_64-darwin.nixpkgs-fmt;
|
||||||
|
aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.nixpkgs-fmt;
|
||||||
|
x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
pwgen
|
pwgen
|
||||||
qemu
|
qemu
|
||||||
radare2
|
radare2
|
||||||
ripgrep
|
|
||||||
rustup
|
rustup
|
||||||
socat
|
socat
|
||||||
swiftformat
|
swiftformat
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue