1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-30 11:37: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"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; 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 = { outputs = {
nixpkgs, nixpkgs,
home-manager, home-manager,
# plasma-manager,
... ...
}: }:
let let
lib = nixpkgs.lib; lib = nixpkgs.lib;
importConfiguration = directory: { importConfiguration = directory: {
nixosConfigurations.${builtins.baseNameOf directory} = lib.nixosSystem { nixosConfigurations.${builtins.baseNameOf directory} =
let
hostPlatform = import (directory + "/platform.nix");
in
lib.nixosSystem {
specialArgs = { specialArgs = {
inherit lib; # plasma-manager; inherit lib;
pkgs = import nixpkgs { pkgs = import nixpkgs {
system = hostPlatform;
config.allowUnfree = true; config.allowUnfree = true;
}; };
homeManagerConfiguration = attrs: homeManagerConfiguration = attrs: {
let home-manager.users.${import (directory + "/username.nix")} = attrs;
userName = import (directory + "username.nix");
in
{
home-manager.users.${userName} = attrs;
}; };
}; };
@ -56,6 +50,7 @@
directory directory
{ {
networking.hostName = builtins.baseNameOf directory; networking.hostName = builtins.baseNameOf directory;
nixpkgs.hostPlatform = hostPlatform;
} }
home-manager.nixosModules.home-manager 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 #!/bin/sh
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then 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 exit
fi fi
sudo true sudo true
echo -e "\n*** LINKING *** \n" if [ -n "$1" ]; then
./link.sh machine = $1
else
read -p "What machine would you want to build? [$(ls --format=commas machines)]: " machine
fi
echo -e "\n*** REBUILDING SYSTEM ***\n" echo -e "\n*** REBUILDING SYSTEM ***\n"
sudo nixos-rebuild switch sudo nixos-rebuild switch --flake .#$machine
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
exit 1 exit 1