cosmic-initial-setup: init at 1.0.0-beta.1.1

This commit is contained in:
Heitor Augusto 2025-09-07 11:15:13 -03:00
commit a3b4bdbb84
No known key found for this signature in database
GPG key ID: 53C04F8F46A1A344
3 changed files with 240 additions and 0 deletions

View file

@ -0,0 +1,74 @@
diff --git a/src/main.rs b/src/main.rs
index a0e8f2e..07cf8b9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -194,19 +194,19 @@ impl Application for App {
}
}
- page::Message::Language(message) => {
- if let Some(page) =
- self.pages.get_mut(&TypeId::of::<page::language::Page>())
- {
- return page
- .as_any()
- .downcast_mut::<page::language::Page>()
- .unwrap()
- .update(message)
- .map(Message::PageMessage)
- .map(cosmic::Action::App);
- }
- }
+ // page::Message::Language(message) => {
+ // if let Some(page) =
+ // self.pages.get_mut(&TypeId::of::<page::language::Page>())
+ // {
+ // return page
+ // .as_any()
+ // .downcast_mut::<page::language::Page>()
+ // .unwrap()
+ // .update(message)
+ // .map(Message::PageMessage)
+ // .map(cosmic::Action::App);
+ // }
+ // }
page::Message::Layout(message) => {
if let Some(page) = self.pages.get_mut(&TypeId::of::<page::layout::Page>())
diff --git a/src/page/mod.rs b/src/page/mod.rs
index 389728c..937a1b3 100644
--- a/src/page/mod.rs
+++ b/src/page/mod.rs
@@ -4,7 +4,7 @@ use std::any::{Any, TypeId};
pub mod appearance;
pub mod keyboard;
-pub mod language;
+// pub mod language;
pub mod launcher;
pub mod layout;
pub mod location;
@@ -34,10 +34,10 @@ pub fn pages(mode: AppMode) -> IndexMap<TypeId, Box<dyn Page>> {
if let AppMode::NewInstall { create_user } = mode {
pages.insert(TypeId::of::<wifi::Page>(), Box::new(wifi::Page::default()));
- pages.insert(
- TypeId::of::<language::Page>(),
- Box::new(language::Page::new()),
- );
+ // pages.insert(
+ // TypeId::of::<language::Page>(),
+ // Box::new(language::Page::new()),
+ // );
pages.insert(
TypeId::of::<keyboard::Page>(),
@@ -95,7 +95,7 @@ pub fn pages(mode: AppMode) -> IndexMap<TypeId, Box<dyn Page>> {
pub enum Message {
Appearance(appearance::Message),
Keyboard(keyboard::Message),
- Language(language::Message),
+ // Language(language::Message),
Layout(layout::Message),
Location(location::Message),
SetTheme(cosmic::Theme),

View file

@ -0,0 +1,64 @@
diff --git a/src/main.rs b/src/main.rs
index a0e8f2e..b6ff8dc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -221,7 +221,7 @@ impl Application for App {
}
}
- page::Message::Location(message) => {
+ /* page::Message::Location(message) => {
if let Some(page) =
self.pages.get_mut(&TypeId::of::<page::location::Page>())
{
@@ -233,7 +233,7 @@ impl Application for App {
.map(Message::PageMessage)
.map(cosmic::Action::App);
}
- }
+ } */
page::Message::User(message) => {
if let Some(page) = self.pages.get_mut(&TypeId::of::<page::user::Page>()) {
diff --git a/src/page/mod.rs b/src/page/mod.rs
index 389728c..38ced5e 100644
--- a/src/page/mod.rs
+++ b/src/page/mod.rs
@@ -7,7 +7,7 @@ pub mod keyboard;
pub mod language;
pub mod launcher;
pub mod layout;
-pub mod location;
+// pub mod location;
pub mod new_apps;
pub mod new_shortcuts;
pub mod user;
@@ -48,10 +48,10 @@ pub fn pages(mode: AppMode) -> IndexMap<TypeId, Box<dyn Page>> {
pages.insert(TypeId::of::<user::Page>(), Box::new(user::Page::default()));
}
- pages.insert(
+ /* pages.insert(
TypeId::of::<location::Page>(),
Box::new(location::Page::new()),
- );
+ ); */
}
pages.insert(
@@ -97,7 +97,7 @@ pub enum Message {
Keyboard(keyboard::Message),
Language(language::Message),
Layout(layout::Message),
- Location(location::Message),
+ // Location(location::Message),
SetTheme(cosmic::Theme),
User(user::Message),
Welcome(welcome::Message),
@@ -150,4 +150,4 @@ pub trait Page {
fn view(&self) -> Element<'_, Message> {
widget::text::body("TODO").into()
}
-}
+}
\ No newline at end of file

View file

@ -0,0 +1,102 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
just,
libcosmicAppHook,
libinput,
openssl,
udev,
nixosTests,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "cosmic-initial-setup";
version = "1.0.0-beta.1.1";
src = fetchFromGitHub {
owner = "pop-os";
repo = "cosmic-initial-setup";
tag = "epoch-${finalAttrs.version}";
hash = "sha256-kjJqGNcIlnzEsfA4eQ9D23ZGgRcmWQyWheAlwpjfALA=";
};
cargoHash = "sha256-orwK9gcFXK4/+sfwRubcz0PP6YAFqsENRHnlSLttLxM=";
# cargo-auditable fails during the build when compiling the `crabtime::function`
# procedural macro. It panics because the `--out-dir` flag is not passed to
# the rustc wrapper.
#
# Reported this issue upstream in:
# https://github.com/rust-secure-code/cargo-auditable/issues/225
auditable = false;
nativeBuildInputs = [
libcosmicAppHook
just
];
buildInputs = [
libinput
openssl
udev
];
# These are not needed for NixOS
patches = [
./disable-language-page.patch
./disable-timezone-page.patch
];
postPatch = ''
# Installs in $out/etc/xdg/autostart instead of /etc/xdg/autostart
substituteInPlace justfile \
--replace-fail \
"autostart-dst := rootdir / 'etc' / 'xdg' / 'autostart' / desktop-entry" \
"autostart-dst := prefix / 'etc' / 'xdg' / 'autostart' / desktop-entry"
'';
dontUseJustBuild = true;
dontUseJustCheck = true;
justFlags = [
"--set"
"prefix"
(placeholder "out")
"--set"
"cargo-target-dir"
"target/${stdenv.hostPlatform.rust.cargoShortTarget}"
];
env.DISABLE_IF_EXISTS = "/iso/nix-store.squashfs";
passthru = {
tests = {
inherit (nixosTests)
cosmic
cosmic-autologin
cosmic-noxwayland
cosmic-autologin-noxwayland
;
};
updateScript = nix-update-script {
extraArgs = [
"--version"
"unstable"
"--version-regex"
"epoch-(.*)"
];
};
};
meta = {
description = "COSMIC Initial Setup";
homepage = "https://github.com/pop-os/cosmic-initial-setup";
license = lib.licenses.gpl3Only;
mainProgram = "cosmic-initial-setup";
platforms = lib.platforms.linux;
teams = [ lib.teams.cosmic ];
};
})