tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
cosmic-initial-setup: init at 1.0.0-beta.1.1
Heitor Augusto
4 months ago
a3b4bdbb
a7ddabfa
+240
3 changed files
expand all
collapse all
unified
split
pkgs
by-name
co
cosmic-initial-setup
disable-language-page.patch
disable-timezone-page.patch
package.nix
+74
pkgs/by-name/co/cosmic-initial-setup/disable-language-page.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
diff --git a/src/main.rs b/src/main.rs
2
+
index a0e8f2e..07cf8b9 100644
3
+
--- a/src/main.rs
4
+
+++ b/src/main.rs
5
+
@@ -194,19 +194,19 @@ impl Application for App {
6
+
}
7
+
}
8
+
9
+
- page::Message::Language(message) => {
10
+
- if let Some(page) =
11
+
- self.pages.get_mut(&TypeId::of::<page::language::Page>())
12
+
- {
13
+
- return page
14
+
- .as_any()
15
+
- .downcast_mut::<page::language::Page>()
16
+
- .unwrap()
17
+
- .update(message)
18
+
- .map(Message::PageMessage)
19
+
- .map(cosmic::Action::App);
20
+
- }
21
+
- }
22
+
+ // page::Message::Language(message) => {
23
+
+ // if let Some(page) =
24
+
+ // self.pages.get_mut(&TypeId::of::<page::language::Page>())
25
+
+ // {
26
+
+ // return page
27
+
+ // .as_any()
28
+
+ // .downcast_mut::<page::language::Page>()
29
+
+ // .unwrap()
30
+
+ // .update(message)
31
+
+ // .map(Message::PageMessage)
32
+
+ // .map(cosmic::Action::App);
33
+
+ // }
34
+
+ // }
35
+
36
+
page::Message::Layout(message) => {
37
+
if let Some(page) = self.pages.get_mut(&TypeId::of::<page::layout::Page>())
38
+
diff --git a/src/page/mod.rs b/src/page/mod.rs
39
+
index 389728c..937a1b3 100644
40
+
--- a/src/page/mod.rs
41
+
+++ b/src/page/mod.rs
42
+
@@ -4,7 +4,7 @@ use std::any::{Any, TypeId};
43
+
44
+
pub mod appearance;
45
+
pub mod keyboard;
46
+
-pub mod language;
47
+
+// pub mod language;
48
+
pub mod launcher;
49
+
pub mod layout;
50
+
pub mod location;
51
+
@@ -34,10 +34,10 @@ pub fn pages(mode: AppMode) -> IndexMap<TypeId, Box<dyn Page>> {
52
+
if let AppMode::NewInstall { create_user } = mode {
53
+
pages.insert(TypeId::of::<wifi::Page>(), Box::new(wifi::Page::default()));
54
+
55
+
- pages.insert(
56
+
- TypeId::of::<language::Page>(),
57
+
- Box::new(language::Page::new()),
58
+
- );
59
+
+ // pages.insert(
60
+
+ // TypeId::of::<language::Page>(),
61
+
+ // Box::new(language::Page::new()),
62
+
+ // );
63
+
64
+
pages.insert(
65
+
TypeId::of::<keyboard::Page>(),
66
+
@@ -95,7 +95,7 @@ pub fn pages(mode: AppMode) -> IndexMap<TypeId, Box<dyn Page>> {
67
+
pub enum Message {
68
+
Appearance(appearance::Message),
69
+
Keyboard(keyboard::Message),
70
+
- Language(language::Message),
71
+
+ // Language(language::Message),
72
+
Layout(layout::Message),
73
+
Location(location::Message),
74
+
SetTheme(cosmic::Theme),
+64
pkgs/by-name/co/cosmic-initial-setup/disable-timezone-page.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
diff --git a/src/main.rs b/src/main.rs
2
+
index a0e8f2e..b6ff8dc 100644
3
+
--- a/src/main.rs
4
+
+++ b/src/main.rs
5
+
@@ -221,7 +221,7 @@ impl Application for App {
6
+
}
7
+
}
8
+
9
+
- page::Message::Location(message) => {
10
+
+ /* page::Message::Location(message) => {
11
+
if let Some(page) =
12
+
self.pages.get_mut(&TypeId::of::<page::location::Page>())
13
+
{
14
+
@@ -233,7 +233,7 @@ impl Application for App {
15
+
.map(Message::PageMessage)
16
+
.map(cosmic::Action::App);
17
+
}
18
+
- }
19
+
+ } */
20
+
21
+
page::Message::User(message) => {
22
+
if let Some(page) = self.pages.get_mut(&TypeId::of::<page::user::Page>()) {
23
+
diff --git a/src/page/mod.rs b/src/page/mod.rs
24
+
index 389728c..38ced5e 100644
25
+
--- a/src/page/mod.rs
26
+
+++ b/src/page/mod.rs
27
+
@@ -7,7 +7,7 @@ pub mod keyboard;
28
+
pub mod language;
29
+
pub mod launcher;
30
+
pub mod layout;
31
+
-pub mod location;
32
+
+// pub mod location;
33
+
pub mod new_apps;
34
+
pub mod new_shortcuts;
35
+
pub mod user;
36
+
@@ -48,10 +48,10 @@ pub fn pages(mode: AppMode) -> IndexMap<TypeId, Box<dyn Page>> {
37
+
pages.insert(TypeId::of::<user::Page>(), Box::new(user::Page::default()));
38
+
}
39
+
40
+
- pages.insert(
41
+
+ /* pages.insert(
42
+
TypeId::of::<location::Page>(),
43
+
Box::new(location::Page::new()),
44
+
- );
45
+
+ ); */
46
+
}
47
+
48
+
pages.insert(
49
+
@@ -97,7 +97,7 @@ pub enum Message {
50
+
Keyboard(keyboard::Message),
51
+
Language(language::Message),
52
+
Layout(layout::Message),
53
+
- Location(location::Message),
54
+
+ // Location(location::Message),
55
+
SetTheme(cosmic::Theme),
56
+
User(user::Message),
57
+
Welcome(welcome::Message),
58
+
@@ -150,4 +150,4 @@ pub trait Page {
59
+
fn view(&self) -> Element<'_, Message> {
60
+
widget::text::body("TODO").into()
61
+
}
62
+
-}
63
+
+}
64
+
\ No newline at end of file
+102
pkgs/by-name/co/cosmic-initial-setup/package.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{
2
+
lib,
3
+
stdenv,
4
+
rustPlatform,
5
+
fetchFromGitHub,
6
+
just,
7
+
libcosmicAppHook,
8
+
libinput,
9
+
openssl,
10
+
udev,
11
+
nixosTests,
12
+
nix-update-script,
13
+
}:
14
+
rustPlatform.buildRustPackage (finalAttrs: {
15
+
pname = "cosmic-initial-setup";
16
+
version = "1.0.0-beta.1.1";
17
+
18
+
src = fetchFromGitHub {
19
+
owner = "pop-os";
20
+
repo = "cosmic-initial-setup";
21
+
tag = "epoch-${finalAttrs.version}";
22
+
hash = "sha256-kjJqGNcIlnzEsfA4eQ9D23ZGgRcmWQyWheAlwpjfALA=";
23
+
};
24
+
25
+
cargoHash = "sha256-orwK9gcFXK4/+sfwRubcz0PP6YAFqsENRHnlSLttLxM=";
26
+
27
+
# cargo-auditable fails during the build when compiling the `crabtime::function`
28
+
# procedural macro. It panics because the `--out-dir` flag is not passed to
29
+
# the rustc wrapper.
30
+
#
31
+
# Reported this issue upstream in:
32
+
# https://github.com/rust-secure-code/cargo-auditable/issues/225
33
+
auditable = false;
34
+
35
+
nativeBuildInputs = [
36
+
libcosmicAppHook
37
+
just
38
+
];
39
+
40
+
buildInputs = [
41
+
libinput
42
+
openssl
43
+
udev
44
+
];
45
+
46
+
# These are not needed for NixOS
47
+
patches = [
48
+
./disable-language-page.patch
49
+
./disable-timezone-page.patch
50
+
];
51
+
52
+
postPatch = ''
53
+
# Installs in $out/etc/xdg/autostart instead of /etc/xdg/autostart
54
+
substituteInPlace justfile \
55
+
--replace-fail \
56
+
"autostart-dst := rootdir / 'etc' / 'xdg' / 'autostart' / desktop-entry" \
57
+
"autostart-dst := prefix / 'etc' / 'xdg' / 'autostart' / desktop-entry"
58
+
'';
59
+
60
+
dontUseJustBuild = true;
61
+
dontUseJustCheck = true;
62
+
63
+
justFlags = [
64
+
"--set"
65
+
"prefix"
66
+
(placeholder "out")
67
+
"--set"
68
+
"cargo-target-dir"
69
+
"target/${stdenv.hostPlatform.rust.cargoShortTarget}"
70
+
];
71
+
72
+
env.DISABLE_IF_EXISTS = "/iso/nix-store.squashfs";
73
+
74
+
passthru = {
75
+
tests = {
76
+
inherit (nixosTests)
77
+
cosmic
78
+
cosmic-autologin
79
+
cosmic-noxwayland
80
+
cosmic-autologin-noxwayland
81
+
;
82
+
};
83
+
84
+
updateScript = nix-update-script {
85
+
extraArgs = [
86
+
"--version"
87
+
"unstable"
88
+
"--version-regex"
89
+
"epoch-(.*)"
90
+
];
91
+
};
92
+
};
93
+
94
+
meta = {
95
+
description = "COSMIC Initial Setup";
96
+
homepage = "https://github.com/pop-os/cosmic-initial-setup";
97
+
license = lib.licenses.gpl3Only;
98
+
mainProgram = "cosmic-initial-setup";
99
+
platforms = lib.platforms.linux;
100
+
teams = [ lib.teams.cosmic ];
101
+
};
102
+
})