Skip to content

Commit

Permalink
init install-system in rust
Browse files Browse the repository at this point in the history
  • Loading branch information
BCNelson committed Dec 6, 2024
1 parent 4d6586f commit 5f0cd35
Show file tree
Hide file tree
Showing 12 changed files with 376 additions and 58 deletions.
48 changes: 24 additions & 24 deletions flake.lock

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

12 changes: 6 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@

inputs = {
# Nixpkgs
nixpkgs23-11.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs24-05.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs24-11.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";

# Home manager
home-manager23-11.url = "github:nix-community/home-manager/release-23.11";
home-manager23-11.inputs.nixpkgs.follows = "nixpkgs23-11";

home-manager24-05.url = "github:nix-community/home-manager/release-24.05";
home-manager24-05.inputs.nixpkgs.follows = "nixpkgs24-05";

home-manager24-11.url = "github:nix-community/home-manager/release-24.11";
home-manager24-11.inputs.nixpkgs.follows = "nixpkgs24-11";

home-manager-unstable.url = "github:nix-community/home-manager/master";
home-manager-unstable.inputs.nixpkgs.follows = "nixpkgs-unstable";

Expand Down Expand Up @@ -90,8 +90,8 @@
"sierra-2" = libx.mkHost { hostname = "sierra-2"; usernames = [ "bcnelson" ]; desktop = "kde6"; inherit libx; version = "unstable"; };
"xray-2" = libx.mkHost { hostname = "xray-2"; usernames = [ "bcnelson" "hlnelson" ]; desktop = "kde6"; inherit libx; version = "unstable"; };
"golf-2" = libx.mkHost { hostname = "golf-2"; usernames = [ "bcnelson" ]; desktop = "kde6"; inherit libx; version = "unstable"; };
"iso_console" = libx.mkHost { hostname = "iso_console"; usernames = [ "nixos" ]; nixosMods = inputs.nixpkgs24-05 + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"; inherit libx; };
"iso_desktop" = libx.mkHost { hostname = "iso_desktop"; usernames = [ "nixos" ]; nixosMods = inputs.nixpkgs24-05 + "/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares.nix"; desktop = "kde6"; inherit libx; };
"iso_console" = libx.mkHost { hostname = "iso_console"; usernames = [ "nixos" ]; nixosMods = inputs.nixpkgs24-11 + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"; inherit libx; };
"iso_desktop" = libx.mkHost { hostname = "iso_desktop"; usernames = [ "nixos" ]; nixosMods = inputs.nixpkgs24-11 + "/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares.nix"; desktop = "kde6"; inherit libx; };
# "vm_test" = libx.mkHost { hostname = "vm_test"; usernames = [ "bcnelson" ]; inherit libx; version = "unstable"; };
"romeo-2" = libx.mkHost { hostname = "romeo-2"; usernames = [ "bcnelson" ]; inherit libx; version = "unstable"; };
"whiskey-1" = libx.mkHost { hostname = "whiskey-1"; usernames = [ "bcnelson" ]; inherit libx; nixosMods = disko.nixosModules.disko; version = "unstable"; };
Expand Down
1 change: 1 addition & 0 deletions home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
overlays = [
inputs.nur.overlay
outputs.overlays.unstable-packages
outputs.overlays.additions
];
config = {
allowUnfreePredicate = _pkg: true;
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ isoTest version='iso_desktop': (isoCreate version)
mkdir -p {{ justfile_directory() }}/test_vm
qemu-img create -f qcow2 "$DISK_IMAGE" "4096M"
fi
ISO=$(head -n1 {{ justfile_directory() }}/../result/nix-support/hydra-build-products | cut -d'/' -f6)
ISO=$(head -n1 {{ justfile_directory() }}/result/nix-support/hydra-build-products | cut -d'/' -f6)
qemu-system-x86_64 -enable-kvm -m 4096 -cdrom {{ justfile_directory() }}/result/iso/$ISO -drive cache=writeback,file="$DISK_IMAGE",format=qcow2,media=disk
isoInstall: isoCreate
Expand Down
12 changes: 6 additions & 6 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ let
home-manager = inputs.home-manager-unstable;
};
stable = {
nixpkgs = inputs.nixpkgs24-05;
home-manager = inputs.home-manager24-05;
};
"23.11" = {
nixpkgs = inputs.nixpkgs23-11;
home-manager = inputs.home-manager23-11;
nixpkgs = inputs.nixpkgs24-11;
home-manager = inputs.home-manager24-11;
};
"24.05" = {
nixpkgs = inputs.nixpkgs24-05;
home-manager = inputs.home-manager24-05;
};
"24.11" = {
nixpkgs = inputs.nixpkgs24-11;
home-manager = inputs.home-manager24-11;
};
};

getSecretWithDefault = path: key: default:
Expand Down
9 changes: 2 additions & 7 deletions nixos/_mixins/users/nixos/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{ config, desktop, lib, pkgs, ... }:
{ outputs ,config, desktop, lib, pkgs, ... }:
let
ifExists = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
install-system = pkgs.writeShellApplication {
name = "install-system";
runtimeInputs = with pkgs; [ git gnupg git-crypt coreutils ];
text = builtins.readFile ./install-system.sh;
};
in
{
# Only include desktop components if one is supplied.
Expand All @@ -29,6 +24,6 @@ in
};

config.system.stateVersion = lib.mkForce lib.trivial.release;
config.environment.systemPackages = [ install-system ];
config.environment.systemPackages = [ pkgs.install-system ];
config.services.kmscon.autologinUser = "nixos";
}
1 change: 1 addition & 0 deletions nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ in
# outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
outputs.overlays.additions
];
config = {
allowUnfree = true;
Expand Down
2 changes: 1 addition & 1 deletion overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{ inputs, ... }:
{
# This one brings our custom packages from the 'pkgs' directory
# additions = final: _prev: import ../pkgs { pkgs = final; };
additions = final: _prev: import ../pkgs final.pkgs;

# This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really.
Expand Down
Loading

0 comments on commit 5f0cd35

Please sign in to comment.