1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-29 11:07:44 +00:00

Fix: Fix rebuild.sh, flake.nix and remove Plasma Manager

This commit is contained in:
RGBCube 2023-05-03 12:49:58 +03:00
parent 20f62a6441
commit d69bb502f1
5 changed files with 18 additions and 38 deletions

View file

@ -17,38 +17,32 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# plasma-manager = {
# url = "github:pjones/plasma-manager"; # Add "inputs.plasma-manager.homeManagerModules.plasma-manager" to the home-manager.users.${user}.imports
# inputs.nixpkgs.follows = "nixpkgs";
# inputs.home-manager.follows = "home-manager";
# };
};
outputs = {
nixpkgs,
home-manager,
# plasma-manager,
...
}:
let
lib = nixpkgs.lib;
importConfiguration = directory: {
nixosConfigurations.${builtins.baseNameOf directory} = lib.nixosSystem {
nixosConfigurations.${builtins.baseNameOf directory} =
let
hostPlatform = import (directory + "/platform.nix");
in
lib.nixosSystem {
specialArgs = {
inherit lib; # plasma-manager;
inherit lib;
pkgs = import nixpkgs {
system = hostPlatform;
config.allowUnfree = true;
};
homeManagerConfiguration = attrs:
let
userName = import (directory + "username.nix");
in
{
home-manager.users.${userName} = attrs;
homeManagerConfiguration = attrs: {
home-manager.users.${import (directory + "/username.nix")} = attrs;
};
};
@ -56,6 +50,7 @@
directory
{
networking.hostName = builtins.baseNameOf directory;
nixpkgs.hostPlatform = hostPlatform;
}
home-manager.nixosModules.home-manager

14
link.sh
View file

@ -1,14 +0,0 @@
#!/bin/sh
sudo true
echo "* Cleaning /etc/nixos"
sudo rm -rf /etc/nixos
sudo mkdir /etc/nixos
echo "* Linking files"
sudo ln ./flake.nix /etc/nixos/flake.nix
sudo ln ./flake.lock /etc/nixos/flake.lock
sudo ln -s ./system-configuration /etc/nixos/
sudo ln -s ./home-configuration /etc/nixos/

View file

@ -1,5 +0,0 @@
{ ... }:
{
}

View file

@ -0,0 +1 @@
"x86_64-linux"

View file

@ -1,17 +1,20 @@
#!/bin/sh
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
echo "Usage: rebuild.sh [-h | --help] [-c | --clean-garbage]"
echo "Usage: rebuild.sh [-h | --help] [-c | --clean-garbage] [machine]"
exit
fi
sudo true
echo -e "\n*** LINKING *** \n"
./link.sh
if [ -n "$1" ]; then
machine = $1
else
read -p "What machine would you want to build? [$(ls --format=commas machines)]: " machine
fi
echo -e "\n*** REBUILDING SYSTEM ***\n"
sudo nixos-rebuild switch
sudo nixos-rebuild switch --flake .#$machine
if [[ $? != 0 ]]; then
exit 1