Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ereslibre committed Jul 19, 2024
1 parent 0c563d3 commit 0967beb
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/result
3 changes: 0 additions & 3 deletions devbox/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
# Temporary due to spice-autorandr
nixpkgs.config.allowUnsupportedSystem = true;

# Faster ISO creation
isoImage.squashfsCompression = "gzip -Xcompression-level 1";

environment.variables = {
TERMINAL = "terminator";
};
Expand Down
37 changes: 37 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 48 additions & 24 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
sops-nix = {
Expand All @@ -29,6 +33,7 @@
home-manager,
microvm,
nix-darwin,
nixos-generators,
nixos-hardware,
nixpkgs,
sops-nix,
Expand All @@ -43,32 +48,41 @@
};
})
// (let
mapMachineConfigurations = nixpkgs.lib.mapAttrs (host: configuration:
configuration.builder (
let
hmConfiguration = dotfiles.rawHomeManagerConfigurations."${configuration.user}@${host}";
in {
inherit (configuration) system;
modules =
configuration.modules
++ [
{nixpkgs.config.allowUnfree = true;}
{
home-manager = {
users.${configuration.user} = import ./dotfiles/home.nix {
inherit home-manager;
inherit (hmConfiguration) system username homeDirectory stateVersion profile mainlyRemote;
};
useGlobalPkgs = true;
};
}
];
}
));
mapMachineConfigurations = nixpkgs.lib.mapAttrs (
host: configuration:
configuration.builder (
let
hmConfiguration = dotfiles.rawHomeManagerConfigurations."${configuration.user}@${host}";
in
{
inherit (configuration) system;
modules =
configuration.modules
++ [
{nixpkgs.config.allowUnfree = true;}
{
home-manager = {
users.${configuration.user} = import ./dotfiles/home.nix {
inherit home-manager;
inherit (hmConfiguration) system username homeDirectory stateVersion profile mainlyRemote;
};
useGlobalPkgs = true;
};
}
];
}
// (
if configuration.builderArgs == null
then {}
else configuration.builderArgs
)
)
);
in {
darwinConfigurations = mapMachineConfigurations {
"Rafaels-Air" = {
builder = nix-darwin.lib.darwinSystem;
builderArgs = null;
system = "aarch64-darwin";
user = "ereslibre";
modules = [
Expand All @@ -79,17 +93,23 @@
};
nixosConfigurations = mapMachineConfigurations {
"devbox" = {
builder = nixpkgs.lib.nixosSystem;
builder = nixos-generators.nixosGenerate;
builderArgs = rec {
system = "aarch64-linux";
format = "qcow";
specialArgs.diskSize = "102400";
};
system = "aarch64-linux";
user = "ereslibre";
modules = [
{nix.registry.nixpkgs.flake = nixpkgs;}
home-manager.nixosModules.home-manager
./devbox/configuration.nix
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-base.nix"
];
};
"hulk" = {
builder = nixpkgs.lib.nixosSystem;
builderArgs = null;
system = "x86_64-linux";
user = "ereslibre";
modules = [
Expand All @@ -100,6 +120,7 @@
};
"nuc-1" = {
builder = nixpkgs.lib.nixosSystem;
builderArgs = null;
system = "x86_64-linux";
user = "ereslibre";
modules = [
Expand All @@ -111,6 +132,7 @@
};
"nuc-2" = {
builder = nixpkgs.lib.nixosSystem;
builderArgs = null;
system = "x86_64-linux";
user = "ereslibre";
modules = [
Expand All @@ -122,6 +144,7 @@
};
"nuc-3" = {
builder = nixpkgs.lib.nixosSystem;
builderArgs = null;
system = "x86_64-linux";
user = "ereslibre";
modules = [
Expand All @@ -133,6 +156,7 @@
};
"pi-desktop" = {
builder = nixpkgs.lib.nixosSystem;
builderArgs = null;
system = "aarch64-linux";
user = "ereslibre";
modules = [
Expand Down
5 changes: 3 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
defaultHost := "$(hostname -s)"
defaultQcowHost := "devbox"

switch host=defaultHost:
@./.switch.sh {{host}}

build host=defaultHost:
nix build .#nixosConfigurations.{{host}}.config.system.build.toplevel

build-iso host=defaultHost:
nix build --impure .#nixosConfigurations.{{host}}.config.system.build.isoImage
qcow host=defaultQcowHost:
nix build --impure .#nixosConfigurations.{{host}}

fmt:
find . -name "*.nix" | xargs nix develop --command alejandra
Expand Down

0 comments on commit 0967beb

Please sign in to comment.