Compare commits

...

2 Commits

Author SHA1 Message Date
8b28196951 added script to install nixos with one command 2025-01-01 19:28:16 +01:00
9e4b796451 System update 2025-01-01 19:01:11 +01:00
4 changed files with 65 additions and 7 deletions

View File

@ -343,11 +343,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1735735907, "lastModified": 1735745492,
"narHash": "sha256-/AOGn9qJMjrZQyWYbObHTKmWDUP0q9+0TAXOJnq6ik0=", "narHash": "sha256-Vs2IkQx4uDv2YehZ1sCw9K+kuMrBa3opnkGJJhMPNPo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "59a4c43e9ba6db24698c112720a58a334117de83", "rev": "9a9fef316ad191b3086edda465e850af282de4e0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -474,11 +474,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1735735636, "lastModified": 1735748884,
"narHash": "sha256-zSsYco2SV4zDvYDqADNEW2KFfty9maO993kRKBrigcg=", "narHash": "sha256-+0Fl1mesL6RJ9Z8jjQtRgdW6R0C4Ptmm89yZJCOyMgM=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "aff34089c4d66b951d25a0dc1867f7fb93d61a7d", "rev": "7f177fa1cf3d8ede2841cdbbbdb7acaf27e40d57",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -111,7 +111,18 @@
allowUnfree = true; allowUnfree = true;
}; };
}; };
# Systems that can run tests:
supportedSystems = ["aarch64-linux" "i686-linux" "x86_64-linux"];
# Function to generate a set based on supported systems:
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
# Attribute set of nixpkgs for each system:
nixpkgsFor =
forAllSystems (system: import inputs.nixpkgs {inherit system;});
in { in {
# NixOS Configurations
nixosConfigurations = { nixosConfigurations = {
kogami = nixpkgs.lib.nixosSystem { kogami = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
@ -141,6 +152,7 @@
]; ];
}; };
}; };
# Phone Configurations
nixOnDroidConfigurations = { nixOnDroidConfigurations = {
tsunemori = inputs.nix-on-droid.lib.nixOnDroidConfiguration { tsunemori = inputs.nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = import inputs.nixpkgs-droid {system = "aarch64-linux";}; pkgs = import inputs.nixpkgs-droid {system = "aarch64-linux";};
@ -153,5 +165,27 @@
}; };
}; };
}; };
# Install script
packages = forAllSystems (system: let
pkgs = nixpkgsFor.${system};
in {
default = self.packages.${system}.install;
install = pkgs.writeShellApplication {
name = "install";
runtimeInputs = with pkgs; [git busybox gum ];
text = ''${./install.sh} "$@"'';
};
});
apps = forAllSystems (system: {
default = self.apps.${system}.install;
install = {
type = "app";
program = "${self.packages.${system}.install}/bin/install";
};
});
}; };
} }

View File

@ -26,7 +26,7 @@
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
sys = { sys = {
audio.enable = true; audio.enable = true;
bootloader.systemd-boot.enable = true; #bootloader.systemd-boot.enable = true;
desktop = { desktop = {
plasma.enable = false; plasma.enable = false;
gnome.enable = true; gnome.enable = true;

24
install.sh Normal file
View File

@ -0,0 +1,24 @@
#!/bin/sh
if [ $# -gt 0 ]; then
SCRIPT_DIR=$1
else
SCRIPT_DIR=~/.dotfiles
fi
nix-shell -p git --command "git clone https://git.foglar.tech/foglar/dotfiles.git $SCRIPT_DIR"
sudo nixos-generate-config --show-hardware-config >$SCRIPT_DIR/kogami/hardware-configuration.nix
sudo nixos-generate-config --show-hardware-config >$SCRIPT_DIR/ginoza/hardware-configuration.nix
sed -i "0,/shinya/s//$(whoami)/" $SCRIPT_DIR/flake.nix
if [ -z $EDITOR ]; then
EDITOR=nano
fi
$EDITOR $SCRIPT_DIR/flake.nix
profile=$(gum choose kogami ginoza)
sudo nixos-rebuild build --flake $SCRIPT_DIR#"${profile}" --update
gum confirm "Do you want to switch to the new configuration?" && sudo nixos-rebuild switch --flake $SCRIPT_DIR#"${profile}"
gum confirm "Do you want to reboot now?" && sudo reboot