-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161788 from vlinkz/calamares-nixos
calamares: fix calamares modules, add nixos modules, and add new iso
- Loading branch information
Showing
22 changed files
with
801 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13288,6 +13288,12 @@ | |
githubId = 1771332; | ||
name = "László Vaskó"; | ||
}; | ||
vlinkz = { | ||
email = "[email protected]"; | ||
github = "vlinkz"; | ||
githubId = 20145996; | ||
name = "Victor Fuentes"; | ||
}; | ||
vlstill = { | ||
email = "[email protected]"; | ||
github = "vlstill"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# This module defines a NixOS installation CD that contains GNOME. | ||
|
||
{ pkgs, ... }: | ||
|
||
{ | ||
imports = [ ./installation-cd-graphical-calamares.nix ]; | ||
|
||
isoImage.edition = "gnome"; | ||
|
||
services.xserver.desktopManager.gnome = { | ||
# Add Firefox and other tools useful for installation to the launcher | ||
favoriteAppsOverride = '' | ||
[org.gnome.shell] | ||
favorite-apps=[ 'firefox.desktop', 'nixos-manual.desktop', 'org.gnome.Console.desktop', 'org.gnome.Nautilus.desktop', 'gparted.desktop', 'io.calamares.calamares.desktop' ] | ||
''; | ||
|
||
# Override GNOME defaults to disable GNOME tour and disable suspend | ||
extraGSettingsOverrides = '' | ||
[org.gnome.shell] | ||
welcome-dialog-last-shown-version='9999999999' | ||
[org.gnome.settings-daemon.plugins.power] | ||
sleep-inactive-ac-type='nothing' | ||
sleep-inactive-battery-type='nothing' | ||
''; | ||
|
||
extraGSettingsOverridePackages = [ pkgs.gnome.gnome-settings-daemon ]; | ||
|
||
enable = true; | ||
}; | ||
|
||
# Theme calamares with GNOME theme | ||
qt5 = { | ||
enable = true; | ||
platformTheme = "gnome"; | ||
}; | ||
|
||
# Fix scaling for calamares on wayland | ||
environment.variables = { | ||
QT_QPA_PLATFORM = "$([[ $XDG_SESSION_TYPE = \"wayland\" ]] && echo \"wayland\")"; | ||
}; | ||
|
||
services.xserver.displayManager = { | ||
gdm = { | ||
enable = true; | ||
# autoSuspend makes the machine automatically suspend after inactivity. | ||
# It's possible someone could/try to ssh'd into the machine and obviously | ||
# have issues because it's inactive. | ||
# See: | ||
# * https://github.com/NixOS/nixpkgs/pull/63790 | ||
# * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22 | ||
autoSuspend = false; | ||
}; | ||
autoLogin = { | ||
enable = true; | ||
user = "nixos"; | ||
}; | ||
}; | ||
} |
49 changes: 49 additions & 0 deletions
49
nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma5.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# This module defines a NixOS installation CD that contains X11 and | ||
# Plasma 5. | ||
|
||
{ pkgs, ... }: | ||
|
||
{ | ||
imports = [ ./installation-cd-graphical-calamares.nix ]; | ||
|
||
isoImage.edition = "plasma5"; | ||
|
||
services.xserver = { | ||
desktopManager.plasma5 = { | ||
enable = true; | ||
}; | ||
|
||
# Automatically login as nixos. | ||
displayManager = { | ||
sddm.enable = true; | ||
autoLogin = { | ||
enable = true; | ||
user = "nixos"; | ||
}; | ||
}; | ||
}; | ||
|
||
environment.systemPackages = with pkgs; [ | ||
# Graphical text editor | ||
kate | ||
]; | ||
|
||
system.activationScripts.installerDesktop = let | ||
|
||
# Comes from documentation.nix when xserver and nixos.enable are true. | ||
manualDesktopFile = "/run/current-system/sw/share/applications/nixos-manual.desktop"; | ||
|
||
homeDir = "/home/nixos/"; | ||
desktopDir = homeDir + "Desktop/"; | ||
|
||
in '' | ||
mkdir -p ${desktopDir} | ||
chown nixos ${homeDir} ${desktopDir} | ||
ln -sfT ${manualDesktopFile} ${desktopDir + "nixos-manual.desktop"} | ||
ln -sfT ${pkgs.gparted}/share/applications/gparted.desktop ${desktopDir + "gparted.desktop"} | ||
ln -sfT ${pkgs.konsole}/share/applications/org.kde.konsole.desktop ${desktopDir + "org.kde.konsole.desktop"} | ||
ln -sfT ${pkgs.calamares-nixos}/share/applications/io.calamares.calamares.desktop ${desktopDir + "io.calamares.calamares.desktop"} | ||
''; | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This module adds the calamares installer to the basic graphical NixOS | ||
# installation CD. | ||
|
||
{ pkgs, ... }: | ||
let | ||
calamares-nixos-autostart = pkgs.makeAutostartItem { name = "io.calamares.calamares"; package = pkgs.calamares-nixos; }; | ||
in | ||
{ | ||
imports = [ ./installation-cd-graphical-base.nix ]; | ||
|
||
environment.systemPackages = with pkgs; [ | ||
# Calamares for graphical installation | ||
libsForQt5.kpmcore | ||
calamares-nixos | ||
calamares-nixos-autostart | ||
calamares-nixos-extensions | ||
# Needed for calamares QML module packagechooserq | ||
libsForQt5.full | ||
]; | ||
} |
4 changes: 1 addition & 3 deletions
4
nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
nixos/modules/installer/cd-dvd/installation-cd-graphical-plasma5.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ stdenv, fetchFromGitHub, lib }: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "calamares-nixos-extensions"; | ||
version = "0.3.8"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "NixOS"; | ||
repo = "calamares-nixos-extensions"; | ||
rev = version; | ||
sha256 = "MtqAOwlY5euVNAGRl2pRkbg/OolJPNOSQcR4DS5gFz4="; | ||
}; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/{lib,share}/calamares | ||
cp -r modules $out/lib/calamares/ | ||
cp -r config/* $out/share/calamares/ | ||
cp -r branding $out/share/calamares/ | ||
runHook postInstall | ||
''; | ||
|
||
meta = with lib; { | ||
description = "Calamares modules for NixOS"; | ||
homepage = "https://github.com/NixOS/calamares-nixos-extensions"; | ||
license = with licenses; [ gpl3Plus bsd2 cc-by-40 cc-by-sa-40 cc0 ]; | ||
maintainers = with maintainers; [ vlinkz ]; | ||
platforms = platforms.linux; | ||
}; | ||
} |
Oops, something went wrong.