System : Migrate to Flakes.

This commit is contained in:
Dmitry Voronin 2024-01-30 22:23:58 +03:00
parent 853a328412
commit 1d9434f9a5
35 changed files with 123 additions and 62 deletions

View file

@ -44,7 +44,8 @@ function nix_update() {
local target="${1}"
[[ "${target}" = "" ]] && target="${HOSTNAME}"
nixos-rebuild switch -I nixos-config=/root/.config/linux/system/${target}/Configuration.nix
cd ${HOME}/.config/linux/system
nixos-rebuild switch --flake .#${target}
}
# Upgrade system. Applies after reboot.
@ -54,7 +55,8 @@ function nix_upgrade() {
local target="${1}"
[[ "${target}" = "" ]] && target="${HOSTNAME}"
nixos-rebuild boot --upgrade-all -I nixos-config=/root/.config/linux/system/${target}/Configuration.nix
cd ${HOME}/.config/linux/system
nix flake update && nix_update "${target}"
}
# Free up root space.

View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1706238342,
"narHash": "sha256-L/ASTMA6xX8jFzDZcGEypNRlA1bj6DhCYechA6w1/Zo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "952b64947e0b1300600dda555db35d09122b9612",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"rev": "952b64947e0b1300600dda555db35d09122b9612",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -0,0 +1,31 @@
{
# inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.nixpkgs.url = "github:nixos/nixpkgs/952b64947e0b1300600dda555db35d09122b9612";
outputs = { self, nixpkgs }@inputs: {
nixosConfigurations.dasha = nixpkgs.lib.nixosSystem {
modules = [ ./host/dasha/Configuration.nix ];
specialArgs.inputs = inputs;
system = "x86_64-linux";
};
nixosConfigurations.desktop = nixpkgs.lib.nixosSystem {
modules = [ ./host/desktop/Configuration.nix ];
specialArgs.inputs = inputs;
system = "x86_64-linux";
};
nixosConfigurations.home = nixpkgs.lib.nixosSystem {
modules = [ ./host/home/Configuration.nix ];
specialArgs.inputs = inputs;
system = "x86_64-linux";
};
nixosConfigurations.laptop = nixpkgs.lib.nixosSystem {
modules = [ ./host/laptop/Configuration.nix ];
specialArgs.inputs = inputs;
system = "x86_64-linux";
};
nixosConfigurations.work = nixpkgs.lib.nixosSystem {
modules = [ ./host/work/Configuration.nix ];
specialArgs.inputs = inputs;
system = "x86_64-linux";
};
};
}

View file

@ -4,15 +4,15 @@
imports = [
./HardwareConfiguration.nix
./Tablet.nix
../Common.nix
../PowersaveIntel.nix
../AmdGpu.nix
../Print.nix
../Gnome.nix
../Dasha.nix
../Flatpak.nix
../DockerRootless.nix
../Sshd.nix
../../module/Common.nix
../../module/PowersaveIntel.nix
../../module/AmdGpu.nix
../../module/Print.nix
../../module/Gnome.nix
../../module/Dasha.nix
../../module/Flatpak.nix
../../module/DockerRootless.nix
../../module/Sshd.nix
];
# Network.

View file

@ -3,15 +3,15 @@
{
imports = [
./HardwareConfiguration.nix
../Common.nix
../PowersaveAmd.nix
../AmdGpu.nix
../Print.nix
../Gnome.nix
../Voronind.nix
../Flatpak.nix
../DockerRootless.nix
../Sshd.nix
../../module/Common.nix
../../module/PowersaveAmd.nix
../../module/AmdGpu.nix
../../module/Print.nix
../../module/Gnome.nix
../../module/Voronind.nix
../../module/Flatpak.nix
../../module/DockerRootless.nix
../../module/Sshd.nix
];
# Network.

View file

@ -7,15 +7,15 @@
./Nextcloud.nix
./PhotosProcess.nix
./YandexMusic.nix
../Common.nix
../Flatpak.nix
../Voronind.nix
../Gnome.nix
../Ftpd.nix
../PowersaveAmd.nix
../AmdGpu.nix
../Docker.nix
../Sshd.nix
../../module/Common.nix
../../module/Flatpak.nix
../../module/Voronind.nix
../../module/Gnome.nix
../../module/Ftpd.nix
../../module/PowersaveAmd.nix
../../module/AmdGpu.nix
../../module/Docker.nix
../../module/Sshd.nix
];
# Network.

View file

@ -4,16 +4,16 @@
imports = [
./HardwareConfiguration.nix
# ./MsiKeyboard.nix
../Common.nix
../AmdGpu.nix
../PowersaveAmd.nix
../Print.nix
../Gnome.nix
../Voronind.nix
../Dasha.nix
../Flatpak.nix
../DockerRootless.nix
../Sshd.nix
../../module/Common.nix
../../module/AmdGpu.nix
../../module/PowersaveAmd.nix
../../module/Print.nix
../../module/Gnome.nix
../../module/Voronind.nix
../../module/Dasha.nix
../../module/Flatpak.nix
../../module/DockerRootless.nix
../../module/Sshd.nix
];
# Network.

View file

@ -0,0 +1,23 @@
{ config, pkgs, ... }:
{
imports = [
./HardwareConfiguration.nix
./Fprint.nix
../../module/Common.nix
../../module/PowersaveIntel.nix
../../module/Powerlimit.nix
../../module/Print.nix
../../module/Gnome.nix
../../module/Voronind.nix
../../module/Flatpak.nix
../../module/DockerRootless.nix
../../module/Sshd.nix
];
# Network.
networking.hostName = "work";
# Do not touch ever.
system.stateVersion = "23.11";
}

View file

@ -20,6 +20,7 @@
lshw
gnome.gnome-tweaks
gnumake
imagemagick
lsof
ncdu
neovim

View file

@ -1,23 +0,0 @@
{ config, pkgs, ... }:
{
imports = [
./HardwareConfiguration.nix
./Fprint.nix
../Common.nix
../PowersaveIntel.nix
../Powerlimit.nix
../Print.nix
../Gnome.nix
../Voronind.nix
../Flatpak.nix
../DockerRootless.nix
../Sshd.nix
];
# Network.
networking.hostName = "work";
# Do not touch ever.
system.stateVersion = "23.11";
}